Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Data Structures | Macros | Typedefs | Functions | Variables
mem.h File Reference
#include "chunk.h"
#include "kernel.h"
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>

Go to the source code of this file.

Data Structures

struct  cons_struct
struct  dl_cons_struct
struct  hash_table_struct
struct  item_in_hash_table_struct
struct  memory_pool_struct

Macros

#define decrement_used_count(p)   { }
#define fast_remove_from_dll(header, item, typename, next_field_name, prev_field_name)
#define fill_with_garbage(block, size)   { }
#define HASH_TABLE_MEM_USAGE   1
#define increment_used_count(p)   { }
#define insert_at_head_of_dll(header, item, next_field_name, prev_field_name)
#define MAX_POOL_NAME_LENGTH   15
#define MISCELLANEOUS_MEM_USAGE   0
#define NUM_MEM_USAGE_CODES   5
#define POOL_MEM_USAGE   3
#define remove_from_dll(header, item, next_field_name, prev_field_name)
#define STATS_OVERHEAD_MEM_USAGE   4
#define STRING_MEM_USAGE   2

Typedefs

typedef char Bool
typedef item_in_hash_tablebucket_array
typedef struct cons_struct cons
typedef Bool(* cons_test_fn )(agent *thisAgent, cons *c, void *data)
typedef struct dl_cons_struct dl_cons
typedef Bool(* dl_cons_test_fn )(dl_cons *dc, agent *thisAgent)
typedef dl_cons dl_list
typedef void * growable_string
typedef struct hash_table_struct hash_table
typedef Bool(* hash_table_callback_fn )(void *item)
typedef Bool(* hash_table_callback_fn2 )(agent *thisAgent, void *item, void *f)
typedef struct
item_in_hash_table_struct 
item_in_hash_table
typedef cons list
typedef struct memory_pool_struct memory_pool

Functions

void add_block_to_memory_pool (agent *thisAgent, memory_pool *p)
void add_to_growable_string (agent *thisAgent, growable_string *gs, const char *string_to_add)
void add_to_hash_table (agent *thisAgent, struct hash_table_struct *ht, void *item)
void * allocate_memory (agent *thisAgent, size_t size, int usage_code)
void * allocate_memory_and_zerofill (agent *thisAgent, size_t size, int usage_code)
Bool cons_equality_fn (agent *, cons *c, void *data)
void do_for_all_items_in_hash_bucket (struct hash_table_struct *ht, hash_table_callback_fn f, uint32_t hash_value)
void do_for_all_items_in_hash_table (agent *thisAgent, struct hash_table_struct *ht, hash_table_callback_fn2 f, void *userdata)
dl_listextract_dl_list_elements (agent *thisAgent, dl_list **header, dl_cons_test_fn f)
void free_growable_string (agent *thisAgent, growable_string gs)
void free_hash_table (agent *thisAgent, struct hash_table_struct *ht)
void free_list (agent *thisAgent,::list *the_list)
void free_memory (agent *thisAgent, void *mem, int usage_code)
void free_memory_block_for_string (agent *thisAgent, char *p)
void free_memory_pool (agent *, memory_pool *p)
void init_memory_pool (agent *thisAgent, memory_pool *p, size_t item_size, const char *name)
void init_memory_utilities (agent *thisAgent)
intlength_of_growable_string (growable_string gs)
growable_string make_blank_growable_string (agent *thisAgent)
struct hash_table_structmake_hash_table (agent *thisAgent, short minimum_log2size, hash_function h)
char * make_memory_block_for_string (agent *thisAgent, char const *s)
Bool member_of_list (void *item,::list *the_list)
intmemsize_of_growable_string (growable_string gs)
void print_memory_statistics (agent *thisAgent)
void remove_from_hash_table (agent *thisAgent, struct hash_table_struct *ht, void *item)
char * savestring (char *x)
char * text_of_growable_string (growable_string gs)
typedef uint32_t ((*hash_function)(void *item, short num_bits))

Variables

uint32_t masks_for_n_low_order_bits [33]

Macro Definition Documentation

#define decrement_used_count (   p)    { }

Definition at line 294 of file mem.h.

#define fast_remove_from_dll (   header,
  item,
  typename,
  next_field_name,
  prev_field_name 
)
Value:
{ \
typename *tempnext, *tempprev; \
tempnext = (item)->next_field_name; \
tempprev = (item)->prev_field_name; \
if (tempnext) tempnext->prev_field_name = tempprev; \
if (tempprev) { \
tempprev->next_field_name = tempnext; \
} else { \
(header) = tempnext; } }

Definition at line 418 of file mem.h.

Referenced by elaborate_gds(), remove_token_and_subtree(), remove_token_from_left_ht(), and remove_wme_from_wm().

#define fill_with_garbage (   block,
  size 
)    { }

Definition at line 174 of file mem.h.

Referenced by allocate_memory(), and free_memory().

#define HASH_TABLE_MEM_USAGE   1
#define increment_used_count (   p)    { }

Definition at line 293 of file mem.h.

#define insert_at_head_of_dll (   header,
  item,
  next_field_name,
  prev_field_name 
)
#define MAX_POOL_NAME_LENGTH   15

Definition at line 242 of file mem.h.

Referenced by init_memory_pool().

#define MISCELLANEOUS_MEM_USAGE   0
#define NUM_MEM_USAGE_CODES   5

Definition at line 184 of file mem.h.

Referenced by init_memory_utilities(), and print_memory_statistics().

#define POOL_MEM_USAGE   3

Definition at line 181 of file mem.h.

Referenced by add_block_to_memory_pool(), free_memory_pool(), and print_memory_statistics().

#define remove_from_dll (   header,
  item,
  next_field_name,
  prev_field_name 
)
#define STATS_OVERHEAD_MEM_USAGE   4

Definition at line 182 of file mem.h.

Referenced by allocate_memory(), free_memory(), and print_memory_statistics().

#define STRING_MEM_USAGE   2

Typedef Documentation

typedef char Bool

Definition at line 198 of file mem.h.

Definition at line 486 of file mem.h.

typedef struct cons_struct cons
typedef Bool(* cons_test_fn)(agent *thisAgent, cons *c, void *data)

Definition at line 459 of file mem.h.

typedef struct dl_cons_struct dl_cons
typedef Bool(* dl_cons_test_fn)(dl_cons *dc, agent *thisAgent)

Definition at line 461 of file mem.h.

typedef dl_cons dl_list

Definition at line 445 of file mem.h.

typedef void* growable_string

Definition at line 199 of file mem.h.

typedef struct hash_table_struct hash_table
typedef Bool(* hash_table_callback_fn)(void *item)

Definition at line 503 of file mem.h.

typedef Bool(* hash_table_callback_fn2)(agent *thisAgent, void *item, void *f)

Definition at line 504 of file mem.h.

typedef cons list

Definition at line 437 of file mem.h.

Function Documentation

void add_block_to_memory_pool ( agent thisAgent,
memory_pool p 
)

Definition at line 224 of file mem.cpp.

References allocate_memory(), DEFAULT_INTERLEAVE_FACTOR, memory_pool_struct::first_block, memory_pool_struct::free_list, memory_pool_struct::item_size, memory_pool_struct::items_per_block, memory_pool_struct::num_blocks, and POOL_MEM_USAGE.

{
char *new_block;
size_t size, i, item_num, interleave_factor;
char *item, *prev_item;
/* --- allocate a new block for the pool --- */
size = p->item_size * p->items_per_block + sizeof(char *);
new_block = static_cast<char *>(allocate_memory (thisAgent, size, POOL_MEM_USAGE));
*(char * *)new_block = static_cast<char *>(p->first_block);
p->first_block = new_block;
p->num_blocks++;
/* somewhere in here, need to check if total mem usage exceeds limit set by user
we only check when increasing pools, because the other memories are small by comparison,
we shouldn't check for every block added to any pool, since that is unduly expensive
can we keep a block counter on the agent and check it modulo some function of the limit?
*/
/*
uint64_t total = 0;
for (i=0; i<NUM_MEM_USAGE_CODES; i++) total += thisAgent->memory_for_usage[i];
if (total > thisAgent->sysparams[MAX_MEMORY_USAGE_SYSPARAM]) {
soar_invoke_callbacks(thisAgent, thisAgent,
MAX_MEMORY_USAGE_CALLBACK,
(soar_call_data) NULL);
print (thisAgent, "%8lu bytes total memory allocated\n", total);
print (thisAgent, "exceeds total allowed for Soar: %8lu bytes \n",
thisAgent->sysparams[MAX_MEMORY_USAGE_SYSPARAM]);
}
*/
/* --- link up the new entries onto the free list --- */
interleave_factor = DEFAULT_INTERLEAVE_FACTOR;
if (interleave_factor >= p->items_per_block) interleave_factor = 1;
item_num = interleave_factor;
prev_item = new_block + sizeof(char *); /* prev_item is item number 0 */
for (i=0; i < p->items_per_block - 1; i++) {
item = new_block + sizeof(char *) + item_num * p->item_size;
*(char * *)prev_item = item;
prev_item = item;
item_num = item_num + interleave_factor;
if (item_num >= p->items_per_block) item_num -= p->items_per_block;
}
*(char * *)prev_item = static_cast<char *>(p->free_list);
p->free_list = new_block + sizeof(char *);
}
void add_to_growable_string ( agent thisAgent,
growable_string gs,
const char *  string_to_add 
)

Definition at line 170 of file mem.cpp.

References allocate_memory(), free_memory(), length_of_growable_string(), memsize_of_growable_string(), STRING_MEM_USAGE, and text_of_growable_string().

Referenced by add_trace_for_attribute_path(), add_trace_for_wme(), add_values_of_attribute_path(), calculate_support_for_instantiation_preferences(), collect_root_variables(), object_to_trace_string(), p_node_left_addition(), parse_head_of_conds_for_one_id(), print_action_list(), print_condition_list(), reorder_simplified_conditions(), restore_and_deallocate_saved_tests(), trace_format_list_to_string(), and write_rhs_function_code().

{
size_t current_length, length_to_add, new_length, new_memsize;
current_length = length_of_growable_string(*gs);
length_to_add = strlen (string_to_add);
new_length = current_length + length_to_add;
if (new_length + 1 > static_cast<size_t>(memsize_of_growable_string(*gs))) {
new_memsize = memsize_of_growable_string(*gs);
while (new_length + 1 > new_memsize) new_memsize = new_memsize * 2;
New = allocate_memory (thisAgent, new_memsize + 2*sizeof(int *), STRING_MEM_USAGE);
memsize_of_growable_string(New) = static_cast<int>(new_memsize);
free_memory (thisAgent, *gs, STRING_MEM_USAGE);
*gs = New;
}
strcpy (text_of_growable_string(*gs)+current_length, string_to_add);
length_of_growable_string(*gs) = static_cast<int>(new_length);
}
void add_to_hash_table ( agent thisAgent,
struct hash_table_struct ht,
void *  item 
)

Definition at line 581 of file mem.cpp.

References hash_table_struct::buckets, hash_table_struct::count, hash_table_struct::h, hash_table_struct::log2size, item_in_hash_table_struct::next, resize_hash_table(), hash_table_struct::size, and uint32_t().

Referenced by add_trace_format(), find_or_make_alpha_mem(), make_float_constant(), make_int_constant(), make_new_identifier(), make_sym_constant(), and make_variable().

{
uint32_t hash_value;
item_in_hash_table *this_one;
this_one = static_cast<item_in_hash_table_struct *>(item);
ht->count++;
if (ht->count >= ht->size*2)
resize_hash_table (thisAgent, ht, ht->log2size+1);
hash_value = (*(ht->h))(item, ht->log2size);
this_one->next = *(ht->buckets+hash_value);
*(ht->buckets+hash_value) = this_one;
}
void* allocate_memory ( agent thisAgent,
size_t  size,
int  usage_code 
)

Definition at line 44 of file mem.cpp.

References abort_with_fatal_error(), BUFFER_MSG_SIZE, fill_with_garbage, agent_struct::memory_for_usage, and STATS_OVERHEAD_MEM_USAGE.

Referenced by add_block_to_memory_pool(), add_rhs_function(), add_to_growable_string(), add_trace_format(), allocate_memory_and_zerofill(), make_blank_growable_string(), make_hash_table(), make_memory_block_for_string(), parse_item_from_format_string(), print_match_set(), read_rest_of_floating_point_number(), reteload_all_symbols(), reteload_alpha_memories(), start_lex_from_file(), and xml_match_set().

{
char *p;
thisAgent->memory_for_usage[usage_code] += size;
size += sizeof(size_t);
thisAgent->memory_for_usage[STATS_OVERHEAD_MEM_USAGE] += sizeof(size_t);
p = static_cast<char *>(malloc (size));
if (p==NULL) {
char msg[BUFFER_MSG_SIZE];
SNPRINTF(msg, BUFFER_MSG_SIZE, "\nmem.c: Error: Tried but failed to allocate %llu bytes of memory.\n", static_cast<long long unsigned>(size));
msg[BUFFER_MSG_SIZE - 1] = 0; /* ensure null termination */
abort_with_fatal_error (thisAgent, msg);
}
if (reinterpret_cast<uintptr_t>(p) & 3) {
char msg[BUFFER_MSG_SIZE];
strncpy (msg,"\nmem.c: Error: Memory allocator returned an address that's not a multiple of 4.\n", BUFFER_MSG_SIZE);
msg[BUFFER_MSG_SIZE - 1] = 0; /* ensure null termination */
abort_with_fatal_error(thisAgent, msg);
}
fill_with_garbage (p, size);
*(reinterpret_cast<size_t *>(p)) = size;
p += sizeof(size_t);
return p;
}
void* allocate_memory_and_zerofill ( agent thisAgent,
size_t  size,
int  usage_code 
)

Definition at line 73 of file mem.cpp.

References allocate_memory().

Referenced by init_rete(), make_hash_table(), resize_hash_table(), and update_max_rhs_unbound_variables().

{
void *p;
p = allocate_memory (thisAgent, size, usage_code);
memset (p, 0, size);
return p;
}
Bool cons_equality_fn ( agent ,
cons c,
void *  data 
)

Definition at line 453 of file mem.cpp.

References cons_struct::first.

Referenced by remove_existing_context_and_descendents().

{
return (c->first == data);
}
void do_for_all_items_in_hash_bucket ( struct hash_table_struct ht,
hash_table_callback_fn  f,
uint32_t  hash_value 
)

Definition at line 610 of file mem.cpp.

References hash_table_struct::buckets, hash_table_struct::log2size, masks_for_n_low_order_bits, item_in_hash_table_struct::next, and NIL.

{
hash_value = hash_value & masks_for_n_low_order_bits[ht->log2size];
item = (item_in_hash_table *) (*(ht->buckets + hash_value));
for ( ; item!=NIL; item = item->next)
if ((*f)(item)) return;
}
void do_for_all_items_in_hash_table ( agent thisAgent,
struct hash_table_struct ht,
hash_table_callback_fn2  f,
void *  userdata 
)

Definition at line 595 of file mem.cpp.

References hash_table_struct::buckets, item_in_hash_table_struct::next, NIL, hash_table_struct::size, and uint32_t().

Referenced by print_all_trace_formats(), print_all_trace_formats_tcl(), print_internal_symbols(), reset_id_and_variable_tc_numbers(), reset_id_counters(), reset_variable_gensym_numbers(), retesave_alpha_memories(), and retesave_symbol_table().

{
uint32_t hash_value;
for (hash_value=0; hash_value < ht->size; hash_value++) {
item = (item_in_hash_table *) (*(ht->buckets + hash_value));
for ( ; item!=NIL; item = item->next)
if ((*f)(thisAgent, item, userdata)) return;
}
}
dl_list* extract_dl_list_elements ( agent thisAgent,
dl_list **  header,
dl_cons_test_fn  f 
)

Definition at line 419 of file mem.cpp.

References dl_cons_struct::next, NIL, dl_cons_struct::prev, and remove_from_dll.

Referenced by print_action_list(), print_condition_list(), and xml_condition_list().

{
dl_cons *first_extracted_element, *tail_of_extracted_elements;
dl_cons *dc, *next_dc;
first_extracted_element = NIL;
tail_of_extracted_elements = NIL;
for (dc=(*header); dc!=NIL; dc=next_dc)
{
next_dc = dc->next;
if (!f(dc,thisAgent))
continue;
remove_from_dll ((*header), dc, next, prev);
if (first_extracted_element)
tail_of_extracted_elements->next = dc;
else
first_extracted_element = dc;
dc->prev = tail_of_extracted_elements;
tail_of_extracted_elements = dc;
}
/************************************************************************/
if (first_extracted_element)
tail_of_extracted_elements->next = NIL;
return first_extracted_element;
}
void free_growable_string ( agent thisAgent,
growable_string  gs 
)
void free_hash_table ( agent thisAgent,
struct hash_table_struct ht 
)

Definition at line 548 of file mem.cpp.

References hash_table_struct::buckets, free_memory(), and HASH_TABLE_MEM_USAGE.

Referenced by destroy_soar_agent().

void free_list ( agent thisAgent,
::list the_list 
)
void free_memory ( agent thisAgent,
void *  mem,
int  usage_code 
)
void free_memory_block_for_string ( agent thisAgent,
char *  p 
)
void free_memory_pool ( agent ,
memory_pool p 
)

Definition at line 274 of file mem.cpp.

References memory_pool_struct::first_block, free_memory(), memory_pool_struct::num_blocks, and POOL_MEM_USAGE.

Referenced by destroy_soar_agent().

{
char *cur_block = static_cast<char*>(p->first_block);
char *next_block;
for(size_t i=0; i<p->num_blocks; i++) {
// the first 4 bytes point to the next block
next_block = *(char **)cur_block;
free_memory(thisAgent, cur_block, POOL_MEM_USAGE);
cur_block = next_block;
}
p->num_blocks = 0;
}
void init_memory_pool ( agent thisAgent,
memory_pool p,
size_t  item_size,
const char *  name 
)

Definition at line 287 of file mem.cpp.

References abort_with_fatal_error(), DEFAULT_BLOCK_SIZE, memory_pool_struct::first_block, memory_pool_struct::free_list, memory_pool_struct::item_size, memory_pool_struct::items_per_block, MAX_POOL_NAME_LENGTH, agent_struct::memory_pools_in_use, memory_pool_struct::name, memory_pool_struct::next, NIL, memory_pool_struct::num_blocks, and memory_pool_struct::used_count.

Referenced by soar_module::get_memory_pool(), init_chunker(), init_decider(), init_firer(), init_memory_utilities(), init_production_utilities(), init_reorderer(), init_rete(), init_soar_agent(), init_soar_io(), and init_symbol_tables().

{
if (item_size < sizeof(char *)) item_size = sizeof(char *);
while (item_size & 3) item_size++; /* make sure item_size is multiple of 4 */
p->item_size = item_size;
p->num_blocks = 0;
p->free_list = NIL;
#ifdef MEMORY_POOL_STATS
p->used_count = 0;
#endif
p->next = thisAgent->memory_pools_in_use;
thisAgent->memory_pools_in_use = p;
if (strlen(name) > MAX_POOL_NAME_LENGTH) {
char msg[2*MAX_POOL_NAME_LENGTH];
SNPRINTF(msg, 2*MAX_POOL_NAME_LENGTH, "mem.c: Internal error: memory pool name too long: %s\n",name);
msg[2*MAX_POOL_NAME_LENGTH - 1] = 0; /* ensure null termination */
abort_with_fatal_error(thisAgent, msg);
}
strncpy(p->name,name,MAX_POOL_NAME_LENGTH);
p->name[MAX_POOL_NAME_LENGTH - 1] = 0; /* ensure null termination */
}
void init_memory_utilities ( agent thisAgent)

Definition at line 629 of file mem.cpp.

References agent_struct::cons_cell_pool, agent_struct::dl_cons_pool, init_memory_pool(), agent_struct::memory_for_usage, and NUM_MEM_USAGE_CODES.

Referenced by create_soar_agent().

{
int i;
init_memory_pool (thisAgent, &thisAgent->cons_cell_pool, sizeof(cons), "cons cell");
init_memory_pool (thisAgent, &thisAgent->dl_cons_pool, sizeof(dl_cons), "dl cons");
for (i=0; i<NUM_MEM_USAGE_CODES; i++) thisAgent->memory_for_usage[i] = 0;
}
int& length_of_growable_string ( growable_string  gs)
inline

Definition at line 222 of file mem.h.

Referenced by add_to_growable_string(), add_trace_for_attribute_path(), make_blank_growable_string(), and trace_format_list_to_string().

{
return (*(((int *)(gs))+1));
}
growable_string make_blank_growable_string ( agent thisAgent)
struct hash_table_struct* make_hash_table ( agent thisAgent,
short  minimum_log2size,
hash_function  h 
)
read

Definition at line 502 of file mem.cpp.

References allocate_memory(), allocate_memory_and_zerofill(), hash_table_struct::buckets, hash_table_struct::count, hash_table_struct::h, HASH_TABLE_MEM_USAGE, hash_table_struct::log2size, hash_table_struct::minimum_log2size, hash_table_struct::size, and uint32_t().

Referenced by init_rete(), init_symbol_tables(), and init_tracing().

{
ht = static_cast<hash_table_struct *>(allocate_memory (thisAgent, sizeof(hash_table),
ht->count = 0;
if (minimum_log2size < 1) minimum_log2size = 1;
ht->size = static_cast<uint32_t>(1) << minimum_log2size;
ht->log2size = minimum_log2size;
ht->minimum_log2size = minimum_log2size;
ht->buckets = static_cast<item_in_hash_table_struct **>(allocate_memory_and_zerofill (thisAgent, ht->size * sizeof(char *),
ht->h = h;
return ht;
}
char* make_memory_block_for_string ( agent thisAgent,
char const *  s 
)

Definition at line 142 of file mem.cpp.

References allocate_memory(), and STRING_MEM_USAGE.

Referenced by make_sym_constant(), make_variable(), parse_item_from_format_string(), parse_production(), reteload_node_and_children(), rl_perform_update(), and start_lex_from_file().

{
char *p;
size_t size;
size = strlen(s)+1; /* plus one for trailing null character */
p = static_cast<char *>(allocate_memory (thisAgent, size, STRING_MEM_USAGE));
strncpy(p,s,size);
p[size-1] = 0; /* ensure null termination */
return p;
}
Bool member_of_list ( void *  item,
::list the_list 
)
int& memsize_of_growable_string ( growable_string  gs)
inline

Definition at line 217 of file mem.h.

Referenced by add_to_growable_string(), and make_blank_growable_string().

{
return (*((int *)(gs)));
}
void print_memory_statistics ( agent thisAgent)

Definition at line 96 of file mem.cpp.

References HASH_TABLE_MEM_USAGE, agent_struct::memory_for_usage, MISCELLANEOUS_MEM_USAGE, NUM_MEM_USAGE_CODES, POOL_MEM_USAGE, print(), STATS_OVERHEAD_MEM_USAGE, and STRING_MEM_USAGE.

{
size_t total;
int i;
total = 0;
for (i=0; i<NUM_MEM_USAGE_CODES; i++) total += thisAgent->memory_for_usage[i];
print (thisAgent, "%8lu bytes total memory allocated\n", total);
print(thisAgent, "%8lu bytes statistics overhead\n",
print(thisAgent, "%8lu bytes for strings\n",
print(thisAgent, "%8lu bytes for hash tables\n",
print(thisAgent, "%8lu bytes for various memory pools\n",
print(thisAgent, "%8lu bytes for miscellaneous other things\n",
}
void remove_from_hash_table ( agent thisAgent,
struct hash_table_struct ht,
void *  item 
)

Definition at line 553 of file mem.cpp.

References hash_table_struct::buckets, hash_table_struct::count, hash_table_struct::h, hash_table_struct::log2size, hash_table_struct::minimum_log2size, item_in_hash_table_struct::next, NIL, resize_hash_table(), hash_table_struct::size, and uint32_t().

Referenced by deallocate_symbol(), remove_ref_to_alpha_mem(), and remove_trace_format().

{
uint32_t hash_value;
item_in_hash_table *this_one, *prev;
this_one = static_cast<item_in_hash_table_struct *>(item);
hash_value = (*(ht->h))(item, ht->log2size);
if (*(ht->buckets+hash_value)==this_one) {
/* --- hs is the first one on the list for the bucket --- */
*(ht->buckets+hash_value) = this_one->next;
} else {
/* --- hs is not the first one on the list, so find its predecessor --- */
prev = *(ht->buckets+hash_value);
while (prev && prev->next != this_one) prev=prev->next;
if ( !prev ) {
/* Reaching here means that we couldn't find this_one item */
assert(prev && "Couldn't find item to remove from hash table!");
return;
}
prev->next = this_one->next;
}
this_one->next = NIL; /* just for safety */
/* --- update count and possibly resize the table --- */
ht->count--;
if ((ht->count < ht->size/2) && (ht->log2size > ht->minimum_log2size))
resize_hash_table (thisAgent, ht, ht->log2size-1);
}
char* savestring ( char *  x)
inline

Definition at line 212 of file mem.h.

Referenced by capitalize_symbol_rhs_function_code(), create_soar_agent(), and trim_rhs_function_code().

{
return strcpy(static_cast<char *>(malloc (strlen (x) + 1)), (x));
}
char* text_of_growable_string ( growable_string  gs)
inline
typedef uint32_t ( (*)(void *item, short num_bits)  hash_function)

Variable Documentation

uint32_t masks_for_n_low_order_bits[33]