1 /* Simple malloc tests.
7 #if defined(__gbz80) || defined(__z80) || defined(__GNUC__)
18 void XDATA *p1, *p2, *p3;
22 #if !defined(__gbz80) && !defined(__z80) && !defined(__GNUC__)
23 init_dynamic_memory((MEMHEADER XDATA *)heap, sizeof(heap));
27 LOG(("p1 == NULL when out of memory\n"));
33 LOG(("p1: %p\n", p1));
35 LOG(("p1: %u\n", (unsigned) p1));
41 LOG(("p2: %p\n", p2));
43 LOG(("p2: %u\n", (unsigned) p2));
47 for (i=0; i<20; i++, p++)
53 LOG(("p2, after expanding realloc: %p\n", p2));
55 LOG(("p2, after expanding realloc: %u\n", (unsigned) p2));
59 for (i=0; i<20; i++, p++)
65 LOG(("p2, after shrinking realloc: %p\n", p2));
67 LOG(("p2, after shrinking realloc: %u\n", (unsigned) p2));
71 for (i=0; i<15; i++, p++)
79 LOG(("p3, after freeing p2: %p\n", p3));
81 LOG(("p3, after freeing p2: %u\n", (unsigned) p3));