src/queue.cpp
changeset 8533 a9b708fe4a00
parent 6678 6353b8865d42
child 8626 440dfcd14c4a
equal deleted inserted replaced
8532:3099f32f9bfd 8533:a9b708fe4a00
   308 	debug("Allocated hash: %p", h);
   308 	debug("Allocated hash: %p", h);
   309 #endif
   309 #endif
   310 	h->hash = hash;
   310 	h->hash = hash;
   311 	h->size = 0;
   311 	h->size = 0;
   312 	h->num_buckets = num_buckets;
   312 	h->num_buckets = num_buckets;
   313 	h->buckets = (HashNode*)malloc(num_buckets * (sizeof(*h->buckets) + sizeof(*h->buckets_in_use)));
   313 	h->buckets = (HashNode*)MallocT<byte>(num_buckets * (sizeof(*h->buckets) + sizeof(*h->buckets_in_use)));
   314 #ifdef HASH_DEBUG
   314 #ifdef HASH_DEBUG
   315 	debug("Buckets = %p", h->buckets);
   315 	debug("Buckets = %p", h->buckets);
   316 #endif
   316 #endif
   317 	h->buckets_in_use = (bool*)(h->buckets + num_buckets);
   317 	h->buckets_in_use = (bool*)(h->buckets + num_buckets);
   318 	for (i = 0; i < num_buckets; i++) h->buckets_in_use[i] = false;
   318 	for (i = 0; i < num_buckets; i++) h->buckets_in_use[i] = false;