Make it compile again (but not link).
authorRobert Haas <rhaas@postgresql.org>
Thu, 16 Jan 2014 15:17:08 +0000 (10:17 -0500)
committerRobert Haas <rhaas@postgresql.org>
Thu, 6 Feb 2014 14:23:00 +0000 (09:23 -0500)
src/backend/utils/mmgr/mspan.c

index 65581e51938d2e5cce062e3e8774ef4547cd7291..4463910ea78f8646f1b4f8069db3942428d6c6c9 100644 (file)
@@ -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.
  */