- add debugging code to memory allocation

= atom to number: cleanup function name as this is more than just supporting SWI
- SrcMask only applies to rules.
- add auxiliary type/error function
- fix typos
- fix enumeration mode in current_flag
- get rid of TrueName routines, use AbsoluteFileName instead.
- detail synatx error source
This commit is contained in:
V'itor Santos Costa
2016-02-11 06:00:56 -08:00
parent f440981b41
commit 74b2b5561d
13 changed files with 121 additions and 75 deletions

View File

@@ -60,11 +60,31 @@ static char SccsId[] = "%W% %G%";
/************************************************************************/
/* Yap workspace management */
#define MASK 0x968e00
#if USE_SYSTEM_MALLOC
#if 0
inline static void * my_malloc(size_t sz)
{
void *p;
p = malloc(sz);
// Yap_DebugPuts(stderr,"gof\n");
return p;
}
inline static void my_free(void *p)
{
printf("f %p\n",p);
free(p);
if (((CELL)p & 0xffffff00) == MASK) jmp_deb(1);
// Yap_DebugPuts(stderr,"gof\n");
}
#else
#define my_malloc(sz) malloc(sz)
#define my_free(ptr) free(ptr)
#endif
#define my_realloc(ptr, sz, osz, safe) realloc(ptr, sz)
#define my_realloc0(ptr, sz) realloc(ptr, sz)
#define my_free(ptr) free(ptr)
#else
#define my_malloc(sz) Yap_dlmalloc(sz)
#define my_realloc0(ptr, sz) Yap_dlrealloc(ptr, sz)