[when in debugging mode, store line number of code that allocated memory with memory block
John Meacham <john@repetae.net>**20070227082901] hunk ./data/jhc_rts.c 75
-static inline void *jhc_malloc(size_t n) {
+#ifndef NDEBUG
+
+#define jhc_malloc(n) jhc_malloc_debug(n,__LINE__)
+
+static inline void * A_MALLOC
+jhc_malloc_debug(size_t n,int line)
+{
+        void *ret = jhc_mem;
+        jhc_mem += ALIGN(__alignof__(void *),sizeof(uintptr_t) + n);
+        *((uintptr_t *)ret) = line;
+//        memset(ret,7,(char *)jhc_mem - (char *)ret);
+//        memset(jhc_mem,8,2*sizeof(void *));
+        return ret + sizeof(uintptr_t);
+}
+
+#else
+
+static inline void * A_MALLOC
+jhc_malloc(size_t n)
+{
hunk ./data/jhc_rts.c 97
-#ifndef NDEBUG
-        memset(ret,7,(char *)jhc_mem - (char *)ret);
-        memset(jhc_mem,8,2*sizeof(void *));
-#endif
hunk ./data/jhc_rts.c 100
+#endif
+
hunk ./data/jhc_rts2.c 73
+ * wptr_t - a value guarenteed to be in whnf
hunk ./data/jhc_rts2.c 81
+typedef struct node * wptr_t;
hunk ./data/jhc_rts2.c 93
-static sptr_t A_UNUSED
+static wptr_t A_STD A_UNUSED
hunk ./data/jhc_rts2.c 100
-static sptr_t A_UNUSED
+static wptr_t A_STD A_UNUSED
hunk ./data/jhc_rts2.c 112
-                        sptr_t r = (*fn)(NODEP(ds));
+                        wptr_t r = (*fn)(NODEP(ds));
hunk ./data/jhc_rts2.c 124
-static void A_UNUSED
-update(sptr_t thunk, sptr_t new)
+static void A_STD A_UNUSED
+update(sptr_t thunk, wptr_t new)
hunk ./utils/debug.gdb 17
+        printf "--- line %u\n", *(uintptr_t *)(((uintptr_t)$arg0 & ~0x3) - sizeof(uintptr_t))
hunk ./utils/debug.gdb 25
+        printf "--- line %u\n", *(uintptr_t *)((uintptr_t)$arg0 - sizeof(uintptr_t))
hunk ./utils/debug.gdb 30
+
+