MCPcopy Create free account
hub / github.com/SoarGroup/Soar / make_hash_table

Function make_hash_table

Core/SoarKernel/src/mem.cpp:573–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571 };
572
573struct hash_table_struct* make_hash_table(agent* thisAgent, short minimum_log2size,
574 hash_function h)
575{
576 hash_table* ht;
577
578 ht = static_cast<hash_table_struct*>(allocate_memory(thisAgent, sizeof(hash_table),
579 HASH_TABLE_MEM_USAGE));
580 ht->count = 0;
581 if (minimum_log2size < 1)
582 {
583 minimum_log2size = 1;
584 }
585 ht->size = static_cast<uint32_t>(1) << minimum_log2size;
586 ht->log2size = minimum_log2size;
587 ht->minimum_log2size = minimum_log2size;
588 ht->buckets = static_cast<item_in_hash_table_struct**>(allocate_memory_and_zerofill(thisAgent, ht->size * sizeof(char*),
589 HASH_TABLE_MEM_USAGE));
590 ht->h = h;
591 return ht;
592}
593
594void resize_hash_table(agent* thisAgent, hash_table* ht, short new_log2size)
595{

Callers 3

init_reteFunction · 0.85
init_tracingFunction · 0.85
init_symbol_tablesFunction · 0.85

Calls 2

allocate_memoryFunction · 0.85

Tested by

no test coverage detected