src/server/daemon/resourcepool.c

changeset 573
76ccfc2a932f
parent 563
6ca97c99173e
child 579
e10457d74fe1
equal deleted inserted replaced
572:e70418bb14b1 573:76ccfc2a932f
39 static CxMap *resource_pool_types; 39 static CxMap *resource_pool_types;
40 40
41 int init_resource_pools(void) { 41 int init_resource_pools(void) {
42 resource_pool_types = cxHashMapCreate(cxDefaultAllocator, CX_STORE_POINTERS, 4); 42 resource_pool_types = cxHashMapCreate(cxDefaultAllocator, CX_STORE_POINTERS, 4);
43 return resource_pool_types ? 0 : 1; 43 return resource_pool_types ? 0 : 1;
44 }
45
46 void resource_pool_cleanup(void) {
47 cxMapDestroy(resource_pool_types);
44 } 48 }
45 49
46 int resourcepool_register_type(const char *type_name, ResourceType *type_info) { 50 int resourcepool_register_type(const char *type_name, ResourceType *type_info) {
47 if(cxMapPut(resource_pool_types, cx_hash_key_str(type_name), type_info)) { 51 if(cxMapPut(resource_pool_types, cx_hash_key_str(type_name), type_info)) {
48 log_ereport(LOG_CATASTROPHE, "resourcepool_register_type: OOM"); 52 log_ereport(LOG_CATASTROPHE, "resourcepool_register_type: OOM");

mercurial