tests/simple_include/Makefile
tests/snprintf/Makefile
tests/test-nevents/Makefile
+ tests/test-libmallocwrap/Makefile
libmallocwrap/Makefile
libinterfork/Makefile
ustd/Makefile
-SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf test-nevents
+SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf test-nevents test-libmallocwrap
noinst_SCRIPTS = test_loop runtests trace_matches
--- /dev/null
+#AM_CPPFLAGS = -I$(top_srcdir)/include
+
+noinst_PROGRAMS = prog
+prog_SOURCES = prog.c
+prog_LDADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o
--- /dev/null
+#include <string.h>
+#include <stdlib.h>
+
+#define N_ITER 1000
+
+int main()
+{
+ int i;
+ const char teststr[] = "Hello World! 1234567890abc";
+ void *ptrs[N_ITER];
+
+ for(i=0; i<N_ITER; i++) {
+ ptrs[i] = malloc(i+1000);
+
+ memcpy(ptrs[i], teststr, sizeof(teststr));
+
+ if(i%2 == 0) {
+ free(ptrs[i]);
+ }
+ }
+
+ for(i=0; i<N_ITER; i++) {
+ if(i%2 == 1)
+ free(ptrs[i]);
+ }
+
+ return 0;
+}