ib_status_t ib_cfgmap_create(ib_cfgmap_t **pcm, ib_mpool_t *pool) { ib_hash_t *hash; ib_status_t rc; /* Underlying hash structure. */ rc = ib_hash_create_nocase(&hash, pool); if (rc != IB_OK) { rc = IB_EALLOC; goto failed; } pool = ib_hash_pool(hash); *pcm = (ib_cfgmap_t *)ib_mpool_alloc(pool, sizeof(**pcm)); if (*pcm == NULL) { rc = IB_EALLOC; goto failed; } (*pcm)->mp = pool; (*pcm)->hash = hash; /* Set by ib_cfgmap_init() */ (*pcm)->base = NULL; return IB_OK; failed: /* Make sure everything is cleaned up on failure. */ *pcm = NULL; return rc; }
//! Memory manager used by hash. MemoryManager memory_manager() const { return MemoryManager(ib_hash_pool(ib())); }