fix garbage collector for dealing with float/longint trie instructions

This commit is contained in:
Ricardo Rocha 2009-08-07 04:34:48 +01:00
parent 7d50687c46
commit 981bee74f0
2 changed files with 17 additions and 12 deletions

View File

@ -2138,8 +2138,8 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose)
vars_ptr -= 2; vars_ptr -= 2;
if (heap_arity) { if (heap_arity) {
while (heap_arity--) { while (heap_arity--) {
if (*vars_ptr == 0) if (*vars_ptr == 0) /* float/longint extension mark */
break; /* term extension mark: float/longint */ break;
mark_external_reference(vars_ptr); mark_external_reference(vars_ptr);
vars_ptr--; vars_ptr--;
} }
@ -3050,8 +3050,8 @@ sweep_choicepoints(choiceptr gc_B)
if (heap_arity) { if (heap_arity) {
while (heap_arity--) { while (heap_arity--) {
CELL cp_cell = *vars_ptr; CELL cp_cell = *vars_ptr;
if (*vars_ptr == 0) if (*vars_ptr == 0) /* float/longint extension mark */
break; /* term extension mark: float/longint */ break;
if (MARKED_PTR(vars_ptr)) { if (MARKED_PTR(vars_ptr)) {
UNMARK(vars_ptr); UNMARK(vars_ptr);
if (HEAP_PTR(cp_cell)) { if (HEAP_PTR(cp_cell)) {

View File

@ -521,10 +521,11 @@
** trie_extension ** ** trie_extension **
** ------------------------ */ ** ------------------------ */
#define stack_trie_extension_instr() \ #define stack_trie_extension_instr() \
*aux_ptr-- = TrNode_entry(node); \ *aux_ptr-- = 0; /* float/longint extension mark */ \
*aux_ptr = heap_arity + 1; \ *aux_ptr-- = TrNode_entry(node); \
YENV = aux_ptr; \ *aux_ptr = heap_arity + 2; \
YENV = aux_ptr; \
next_trie_instruction(node) next_trie_instruction(node)
@ -1233,13 +1234,15 @@
Term t; Term t;
#if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P #if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P
heap_arity -= 4;
*t_dbl = *++aux_ptr; *t_dbl = *++aux_ptr;
++aux_ptr; /* jump the float/longint extension mark */
*(t_dbl + 1) = *++aux_ptr; *(t_dbl + 1) = *++aux_ptr;
heap_arity -= 2;
#else /* SIZEOF_DOUBLE == SIZEOF_INT_P */ #else /* SIZEOF_DOUBLE == SIZEOF_INT_P */
heap_arity -= 2;
*t_dbl = *++aux_ptr; *t_dbl = *++aux_ptr;
heap_arity -= 1;
#endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */ #endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */
++aux_ptr; /* jump the float/longint extension mark */
t = MkFloatTerm(dbl); t = MkFloatTerm(dbl);
stack_trie_float_longint_instr(); stack_trie_float_longint_instr();
ENDPBOp(); ENDPBOp();
@ -1266,9 +1269,11 @@
int heap_arity = *aux_ptr; int heap_arity = *aux_ptr;
int vars_arity = *(aux_ptr + heap_arity + 1); int vars_arity = *(aux_ptr + heap_arity + 1);
int subs_arity = *(aux_ptr + heap_arity + 2); int subs_arity = *(aux_ptr + heap_arity + 2);
Term t = MkLongIntTerm(*++aux_ptr); Term t;
heap_arity -= 1; heap_arity -= 2;
t = MkLongIntTerm(*++aux_ptr);
++aux_ptr; /* jump the float/longint extension mark */
stack_trie_float_longint_instr(); stack_trie_float_longint_instr();
ENDPBOp(); ENDPBOp();