src/hash_map.c

changeset 669
dce9b8450656
parent 668
d7129285ac32
child 677
b09aae58bba4
equal deleted inserted replaced
668:d7129285ac32 669:dce9b8450656
426 cxFree(allocator, map); 426 cxFree(allocator, map);
427 return NULL; 427 return NULL;
428 } 428 }
429 429
430 // initialize base members 430 // initialize base members
431 map->base.store_pointers = false;
432 map->base.cl = &cx_hash_map_class; 431 map->base.cl = &cx_hash_map_class;
433 map->base.allocator = allocator; 432 map->base.allocator = allocator;
434 map->base.size = 0; 433 map->base.size = 0;
435 434
436 if (itemsize > 0) { 435 if (itemsize > 0) {
436 map->base.store_pointers = false;
437 map->base.itemsize = itemsize; 437 map->base.itemsize = itemsize;
438 } else { 438 } else {
439 cxMapStorePointers((CxMap *) map); 439 map->base.store_pointers = true;
440 map->base.itemsize = sizeof(void *);
440 } 441 }
441 442
442 return (CxMap *) map; 443 return (CxMap *) map;
443 } 444 }
444 445

mercurial