summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/memory.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/memory.c b/tests/memory.c
index d4f8cf4..0dd2dfc 100644
--- a/tests/memory.c
+++ b/tests/memory.c
@@ -27,6 +27,8 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include <limits.h>
#include "gmp.h"
+#define TEST_MEMORY 0x1002001D0
+
#define __gmp_default_allocate malloc
#define __gmp_default_reallocate(p,old,new) realloc(p,new)
#define __gmp_default_free(p,size) free(p)
@@ -90,6 +92,11 @@ tests_allocate (size_t size)
h->size = size;
h->ptr = __gmp_default_allocate (size);
+#ifdef TEST_MEMORY
+ if (h->ptr == (void*) TEST_MEMORY)
+ fprintf (stderr, "tests_allocate: allocated %zu at 0x%lX\n",
+ size, (unsigned long) h->ptr);
+#endif
return h->ptr;
}
@@ -126,6 +133,11 @@ tests_reallocate (void *ptr, size_t old_size, size_t new_size)
h->size = new_size;
h->ptr = __gmp_default_reallocate (ptr, old_size, new_size);
+#ifdef TEST_MEMORY
+ if (h->ptr == (void*) TEST_MEMORY)
+ fprintf (stderr, "tests_reallocate: reallocated from %zu to %zu at 0x%lX\n",
+ old_size, new_size, (unsigned long) h->ptr);
+#endif
return h->ptr;
}