Browse code

The hashset's bitmap needs only capacity/32 memory, not capacity/8.

Török Edvin authored on 2010/01/05 00:17:22
Showing 1 changed files
... ...
@@ -434,7 +434,7 @@ int cli_hashset_init(struct cli_hashset* hs, size_t initial_capacity, uint8_t lo
434 434
 	if(!hs->keys) {
435 435
 		return CL_EMEM;
436 436
 	}
437
-	hs->bitmap = cli_calloc(initial_capacity / 8, sizeof(*hs->bitmap));
437
+	hs->bitmap = cli_calloc(initial_capacity >> 5, sizeof(*hs->bitmap));
438 438
 	if(!hs->bitmap) {
439 439
 		free(hs->keys);
440 440
 		return CL_EMEM;