Changeset: 0ce388747452 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0ce388747452
Modified Files:
        gdk/gdk_utils.mx
Branch: Aug2011
Log Message:

Debugging aid: set freshly malloced data to 0xBD.
This only happens in the same case as when GDKfree sets to-be-freed
memory to 0xDB.  The change makes it possible to distinguish between
memory that has been freed (which should not be used) from memory
which has been allocated after it was freed (which may be used).


diffs (13 lines):

diff --git a/gdk/gdk_utils.mx b/gdk/gdk_utils.mx
--- a/gdk/gdk_utils.mx
+++ b/gdk/gdk_utils.mx
@@ -1233,6 +1233,9 @@ GDKmalloc(size_t size)
        void *p;
        p = GDKmallocmax(size, &size, 0);
        ALLOCDEBUG fprintf(stderr, "#GDKmalloc " SZFMT " " SZFMT " " PTRFMT 
"\n", sz, size, PTRFMTCAST p);
+#ifndef NDEBUG
+       DEADBEEFCHK if (p) memset(p, 0xBD, size);
+#endif
        return p;
 }
 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to