void mono_lock_free_allocator_init_size_class (MonoLockFreeAllocSizeClass *sc, unsigned int slot_size) { g_assert (slot_size <= SB_USABLE_SIZE / 2); mono_lock_free_queue_init (&sc->partial); sc->slot_size = slot_size; }
void mono_lock_free_allocator_init_size_class (MonoLockFreeAllocSizeClass *sc, unsigned int slot_size, unsigned int block_size) { g_assert (block_size > 0); g_assert ((block_size & (block_size - 1)) == 0); /* check if power of 2 */ g_assert (slot_size * 2 <= LOCK_FREE_ALLOC_SB_USABLE_SIZE (block_size)); mono_lock_free_queue_init (&sc->partial); sc->slot_size = slot_size; sc->block_size = block_size; }