bug du mode debug

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4091 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Damien Doligez 2001-12-04 10:53:19 +00:00
parent 393ec18f1b
commit cae7e511a7
2 changed files with 6 additions and 8 deletions

View File

@ -320,12 +320,7 @@ void * stat_alloc (asize_t sz)
/* malloc() may return NULL if size is 0 */
if (result == NULL && sz != 0) raise_out_of_memory ();
#ifdef DEBUG
{
value *p;
for (p = result; p < (value *) ((char *) result + sz); p++){
*p = Debug_uninit_stat;
}
}
memset (result, Debug_uninit_stat, sz);
#endif
return result;
}

View File

@ -109,9 +109,11 @@ char *aligned_malloc (asize_t, int, void **);
04 -> fields deallocated by obj_truncate
10 -> uninitialised fields of minor objects
11 -> uninitialised fields of major objects
12 -> uninitialised words of stat_alloc blocks
15 -> uninitialised words of aligned_malloc blocks
85 -> filler bytes of aligned_malloc
special case (byte by byte):
D7 -> uninitialised words of stat_alloc blocks
*/
#define Debug_free_minor Debug_tag (0x00)
#define Debug_free_major Debug_tag (0x01)
@ -119,9 +121,10 @@ char *aligned_malloc (asize_t, int, void **);
#define Debug_free_truncate Debug_tag (0x04)
#define Debug_uninit_minor Debug_tag (0x10)
#define Debug_uninit_major Debug_tag (0x11)
#define Debug_uninit_stat Debug_tag (0x12)
#define Debug_uninit_align Debug_tag (0x15)
#define Debug_filler_align Debug_tag (0x85)
#define Debug_uninit_stat 0xD7
#endif /* DEBUG */