From: David S. W. <dw...@us...> - 2005-07-21 21:05:45
|
Update of /cvsroot/xsb/XSB/emu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7116/emu Modified Files: biassert.c macro_xsb.h Log Message: When tabled dynamic code was abolished, the TIF and any tables computed for that dynamic predicate were left around and their space not reclaimed. This update reclaims the table space and the TIF. Also, abolish did not retract the fact that the dynamic predicate was tabled, so this update fixes that as well. Index: biassert.c =================================================================== RCS file: /cvsroot/xsb/XSB/emu/biassert.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- biassert.c 20 Jul 2005 18:21:54 -0000 1.81 +++ biassert.c 21 Jul 2005 21:04:18 -0000 1.82 @@ -2334,6 +2334,8 @@ if ( *(pb)p == tabletrysingle ) { + TIFptr mtTIF = (TIFptr) *(p+2); + Free_TIF(mtTIF); /* free prref, from calld instr set in db_build_prref */ mem_dealloc((pb)(*(p+6)), sizeof(PrRefData)); if (xsb_profiling_enabled) Index: macro_xsb.h =================================================================== RCS file: /cvsroot/xsb/XSB/emu/macro_xsb.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- macro_xsb.h 20 Jul 2005 16:00:56 -0000 1.24 +++ macro_xsb.h 21 Jul 2005 21:04:24 -0000 1.25 @@ -93,6 +93,23 @@ tif_list.last = pTIF; \ } +#define Free_TIF(pTIF) { \ + TIFptr tTIF = tif_list.first; \ + if (tTIF == (pTIF)) { \ + tif_list.first = TIF_NextTIF((pTIF)); \ + if (tif_list.last == (pTIF)) tif_list.last = NULL; \ + } \ + else { \ + while (tTIF != NULL && TIF_NextTIF(tTIF) != (pTIF)) \ + tTIF = TIF_NextTIF(tTIF); \ + if (!tTIF) xsb_exit("Trying to free nonexistent TIF"); \ + if ((pTIF) == tif_list.last) tif_list.last = tTIF; \ + TIF_NextTIF(tTIF) = TIF_NextTIF((pTIF)); \ + } \ + delete_predicate_table(CTXTc pTIF); \ + mem_dealloc((pTIF),sizeof(TableInfoFrame)); \ +} + /*===========================================================================*/ typedef struct ascc_edge *EPtr; |