From: David S. W. <dw...@us...> - 2005-11-16 22:35:13
|
Update of /cvsroot/xsb/XSB/emu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15914 Modified Files: memory_xsb.h tr_utils.c trace_xsb.c trie_lookup.c Log Message: Minor memory management cleanup, to reduce initial space usage. Index: memory_xsb.h =================================================================== RCS file: /cvsroot/xsb/XSB/emu/memory_xsb.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- memory_xsb.h 16 Nov 2005 17:32:04 -0000 1.23 +++ memory_xsb.h 16 Nov 2005 22:34:54 -0000 1.24 @@ -131,9 +131,10 @@ #define THREAD_SPACE 12 #define READ_CAN_SPACE 13 #define LEAK_SPACE 14 -#define OTHER_SPACE 15 +#define SPECIAL_SPACE 15 +#define OTHER_SPACE 16 -#define NUM_CATS_SPACE 16 +#define NUM_CATS_SPACE 17 /* Program and Symbol Tables Space (in Bytes) ------------------------------------------ */ Index: tr_utils.c =================================================================== RCS file: /cvsroot/xsb/XSB/emu/tr_utils.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- tr_utils.c 16 Nov 2005 17:32:05 -0000 1.93 +++ tr_utils.c 16 Nov 2005 22:34:54 -0000 1.94 @@ -988,7 +988,7 @@ void init_newtrie(CTXTdecl) { first_free_set = 0; - Set_ArraySz = 100; + Set_ArraySz = 10; /* must be at least num_sets */ num_sets = 1; Set_ArrayPtr = (BTNptr *) mem_calloc(Set_ArraySz,sizeof(BTNptr),TABLE_SPACE); Index: trace_xsb.c =================================================================== RCS file: /cvsroot/xsb/XSB/emu/trace_xsb.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- trace_xsb.c 16 Nov 2005 17:32:05 -0000 1.15 +++ trace_xsb.c 16 Nov 2005 22:34:54 -0000 1.16 @@ -100,7 +100,8 @@ {"atom ","asserted ","compiled ","foreign ", "table ","findall ","profile ","mt-private ", "buffer ","gc temp ","hash ","interprolog ", - "thread ","read canon ","leaking... ","other "}; + "thread ","read canon ","leaking... ","special ", + "other "}; void total_stat(CTXTdeclc double elapstime) { Index: trie_lookup.c =================================================================== RCS file: /cvsroot/xsb/XSB/emu/trie_lookup.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- trie_lookup.c 16 Nov 2005 17:32:05 -0000 1.12 +++ trie_lookup.c 16 Nov 2005 22:34:54 -0000 1.13 @@ -109,8 +109,6 @@ static struct VariantContinuation variant_cont; #endif -#define VAR_CONT_INIT_STACK_SIZE 64 - /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #define ContStack_ExpandOnOverflow(Stack,StackSize,NeededSize) { \ @@ -344,17 +342,10 @@ tstCCPStack.ceiling = tstCCPStack.base + CALL_CPSTACK_SIZE; - variant_cont.subterms.stack.ptr = - mem_alloc(VAR_CONT_INIT_STACK_SIZE * - sizeof(variant_cont.subterms.stack.ptr[0]),TABLE_SPACE); - variant_cont.bindings.stack.ptr = - mem_alloc(VAR_CONT_INIT_STACK_SIZE * - sizeof(variant_cont.bindings.stack.ptr[0]),TABLE_SPACE); - if ( IsNULL(variant_cont.subterms.stack.ptr) || - IsNULL(variant_cont.bindings.stack.ptr) ) - xsb_abort("Not enough memory to initialize subsumptive subsystem"); + variant_cont.subterms.stack.ptr = NULL; + variant_cont.bindings.stack.ptr = NULL; variant_cont.subterms.stack.size = - variant_cont.bindings.stack.size = VAR_CONT_INIT_STACK_SIZE; + variant_cont.bindings.stack.size = 0; /* set entries to unbound */ for (i = 0; i < NUM_TRIEVARS; i++) |