/* * pmalloc_boot -- global runtime init routine of allocator section */ int pmalloc_boot(PMEMobjpool *pop) { int ret = palloc_boot(&pop->heap, (char *)pop + pop->heap_offset, pop->set->poolsize - pop->heap_offset, &pop->heap_size, pop, &pop->p_ops, pop->stats, pop->set); if (ret) return ret; #if VG_MEMCHECK_ENABLED if (On_valgrind) palloc_heap_vg_open(&pop->heap, pop->vg_boot); #endif ret = palloc_buckets_init(&pop->heap); if (ret) palloc_heap_cleanup(&pop->heap); return ret; }
/* * pmalloc_boot -- initializes allocator section */ static int pmalloc_boot(PMEMobjpool *pop) { COMPILE_ERROR_ON(PALLOC_DATA_OFF != OBJ_OOB_SIZE); COMPILE_ERROR_ON(ALLOC_BLOCK_SIZE != _POBJ_CL_ALIGNMENT); int ret = palloc_boot(&pop->heap, (char *)pop + pop->heap_offset, pop->heap_size, pop, &pop->p_ops); if (ret) return ret; #ifdef USE_VG_MEMCHECK palloc_heap_vg_open(&pop->heap, obj_vg_register, pop, pop->vg_boot); #endif ret = palloc_buckets_init(&pop->heap); if (ret) palloc_heap_cleanup(&pop->heap); return ret; }