From 89417428a23a978deee36c8063aad4136fa6312c Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 16 Jan 2014 10:17:08 -0500 Subject: [PATCH] Make it compile again (but not link). --- src/backend/utils/mmgr/mspan.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/backend/utils/mmgr/mspan.c b/src/backend/utils/mmgr/mspan.c index 65581e5193..4463910ea7 100644 --- a/src/backend/utils/mmgr/mspan.c +++ b/src/backend/utils/mmgr/mspan.c @@ -57,7 +57,7 @@ * of memory, where the unfilled superblocks will be a small percentage of * the total allocations. */ -static uint16 mspan_size_classes[] = { +static const uint16 mspan_size_classes[] = { 8, 16, 24, 32, 40, 48, 56, 64, /* 8 classes separated by 8 bytes */ 80, 96, 112, 128, /* 4 classes separated by 16 bytes */ 160, 192, 224, 256, /* 4 classes separated by 32 bytes */ @@ -141,9 +141,12 @@ struct mspan_context static int mspan_adjust_superblock_fullness(char *base, mspan_context *cxt, mspan *superblock, int current_fullness_class); +static char *mspan_allocate_from_superblock(char *base, mspan *superblock); static mspan_context *mspan_allocate_context_descriptor(char *base, mspan_manager *mgr); static void mspan_destroy_span(char *base, mspan *span); +static void mspan_ensure_active_superblock(char *base, mspan_context *cxt, + uint16 size_class); static mspan *mspan_find_free_span(char *base, mspan_manager *mgr, Size minpages, Size maxpages); static void mspan_recycle_span(char *base, mspan_manager *mgr, mspan *span); @@ -161,12 +164,12 @@ static void mspan_update_page_map(char *base, mspan_manager *mgr, void mspan_initialize_private_manager(mspan_manager *mgr) { - unsigned bits = SIZEOF_SIZE_T * BITS_PER_BYTE; + const unsigned bits = SIZEOF_SIZE_T * BITS_PER_BYTE; memset(mgr, 0, sizeof(mspan_manager)); aspace_map_initialize(&mgr->page_map, - 1 << (bits - MSPAN_PAGE_BITS), + INT64CONST(1) << (bits - MSPAN_PAGE_BITS), bits <= 32 ? ASPACE_MAP_32BIT_VALUES : 0); } @@ -546,6 +549,18 @@ mspan_allocate_context_descriptor(char *base, mspan_manager *mgr) return cxt; } +/* + * Attempt to allocate an object from a superblock. + */ +static char * +mspan_allocate_from_superblock(char *base, mspan *superblock) +{ + /* + * XXX. Implementation needed. + */ + return NULL; +} + /* * Deallocate a span descriptor. */ @@ -560,6 +575,18 @@ mspan_destroy_span(char *base, mspan *span) */ } +/* + * Ensure that there is an active superblock for the given size class. + */ +static void +mspan_ensure_active_superblock(char *base, mspan_context *cxt, + uint16 size_class) +{ + /* + * XXX. Implementation needed. + */ +} + /* * Find a previously-allocated span that is now available for reuse. */ -- 2.39.5