* 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 */
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);
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);
}
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.
*/
*/
}
+/*
+ * 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.
*/