mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Reduce the size of hashmap_nodes.h file
Instead of keeping the whole array of test_node_t objects, just keep the hashvalues and generated the rest of the test_node_t on the fly. The test still works this way and the file size has been reduced from 2M to 90k.
This commit is contained in:
parent
43c81e2e24
commit
2310c322c0
2 changed files with 1278 additions and 7615 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -233,17 +233,15 @@ test_hashmap_iterator(bool random_data) {
|
|||
isc_hashmap_create(mctx, HASHMAP_MIN_BITS, &hashmap);
|
||||
assert_non_null(hashmap);
|
||||
|
||||
if (random_data) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
/* short keys */
|
||||
snprintf((char *)nodes[i].key, 16, "%u",
|
||||
(unsigned int)i);
|
||||
strlcat((char *)nodes[i].key, " key of a raw hashmap!!",
|
||||
16);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
/* short keys */
|
||||
snprintf((char *)nodes[i].key, 16, "%u", (unsigned int)i);
|
||||
strlcat((char *)nodes[i].key, " key of a raw hashmap!!", 16);
|
||||
if (random_data) {
|
||||
nodes[i].hashval = isc_hash32(nodes[i].key, 16, true);
|
||||
} else {
|
||||
nodes[i].hashval = test_hashvals[i];
|
||||
}
|
||||
} else {
|
||||
memmove(nodes, test_nodes, sizeof(test_nodes));
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue