fix number of overflow bugs affecting threaded version

make current_op faster.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1615 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2006-04-28 13:23:23 +00:00
parent a80878d5f6
commit 6fb10bfc51
12 changed files with 96 additions and 67 deletions

View File

@@ -128,10 +128,11 @@ typedef struct scanner_extra_alloc {
void *filler;
} ScannerExtraBlock;
/* Problem: we use realloc so we cannot guarantee beforehand pointers will shift or not */
#if USE_SYSTEM_MALLOC
#define EXPAND_TRAIL TRUE
#else
#define EXPAND_TRAIL FALSE
#else
#define EXPAND_TRAIL TRUE
#endif
static char *
@@ -155,7 +156,7 @@ AllocScannerMemory(unsigned int size)
if (size > alloc_size)
alloc_size = size;
if(!EXPAND_TRAIL || !Yap_growtrail (alloc_size, TRUE)) {
if(!EXPAND_TRAIL || !Yap_growtrail(alloc_size, TRUE)) {
struct scanner_extra_alloc *ptr;
if (!(ptr = (struct scanner_extra_alloc *)malloc(size+sizeof(ScannerExtraBlock)))) {