Menu

Commit [r7661]  Maximize  Restore  History

Changes to fix problems with expanding VarEnumerator array, the array
that handles variable aliasing when tabling terms. When expanding
this array, we had been doing a realloc. However, expansion may occur
midway through copying a term into a table. If this happens there is
the possibility that the part of the term that is not yet copied could
point into the *old* VarEnumerator array. If this happens with a
realloc, we get a dangling pointer, which was the cause of a core dump
on some flora programs.

My fix was 1) to replace the realloc with a malloc and 2) to grow the
array more aggressively, by powers of 2. This leads to a small memory
leak in certain cases, but the leak is bounded by the current size of
the VarEnumerator array, and so will be insignificant.

tswift 2012-11-16

changed /trunk/XSB/emu/trie_internals.h
changed /trunk/XSB/emu/tries.c
/trunk/XSB/emu/trie_internals.h Diff Switch to side-by-side view
Loading...
/trunk/XSB/emu/tries.c Diff Switch to side-by-side view
Loading...
Monday.com Logo