8 extern unsigned _horg; /* Bottom of heap */
9 extern unsigned _hptr; /* Current top */
10 extern unsigned _hend; /* Upper limit */
11 extern unsigned _hfirst; /* First free block in list */
12 extern unsigned _hlast; /* Last free block in list */
15 static unsigned char* V[256];
19 static void ShowInfo (void)
22 /* Count free blocks */
24 unsigned** P = (unsigned**) _hfirst;
29 printf ("%04X %04X %04X %04X %04X %u\n",
30 _horg, _hptr, _hend, _hfirst, _hlast, Count);
33 P = (unsigned**) _hfirst;
35 printf ("%04X %04X %04X %04X(%u)\n",
36 (unsigned) P, P[2], P[1], P[0], P[0]);
45 static const char* RandStr (void)
46 /* Create a random string */
49 unsigned Len = (rand () & 0xFF) + (sizeof (S) - 0xFF - 1);
53 for (I = 0; I < Len; ++I) {
66 static void FillArray (void)
67 /* Fill the string array */
71 V[I] = strdup (RandStr ());
78 static void FreeArray (void)
79 /* Free all strings in the array */
94 /* Show info at start */
97 /* Remember the time */
106 /* Calculate the time and print it */
108 printf ("Time needed: %lu ticks\n", T);