mem_test.c revision 7ee52cc7d195433bb8f55972e2a8ab29668f7bce
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#ifdef SOLARIS
#include <thread.h>
#endif
#include <isc/assertions.h>
#include "memcluster.h"
char *ptr1[50000];
char *ptr2[50000];
#define ALLOCSZ 100
#define STATS
static void
int i;
#if !defined(LOCKMUTEX)
/* Always "use" mutex, so compilers don't complain. */
#endif
#endif
for (i = 0; i < n; i++) {
#endif
#ifdef USE_MALLOC
#else
p[i] = mem_allocate(m, ALLOCSZ);
#endif
#endif
#if defined(FILL)
{
int j;
for (j = 0; j < ALLOCSZ; j++)
p[i][j] = j;
}
#endif
}
#endif
#endif
for (i = 0; i < n; i++) {
#endif
#ifdef USE_MALLOC
free(p[i]);
#else
mem_free(m, p[i]);
#endif
#endif
p[i] = NULL;
}
#endif
}
static void *
char **p = arg;
#ifdef GLOBALMUTEX
mutexp = &global_mutex;
#else
#endif
#ifdef GLOBALMEMCTX
m = global_ctx;
#else
INSIST(mem_context_create(0, 0, &m) == 0);
#endif
#ifdef STATS
#endif
return (NULL);
}
int
main(void) {
#ifdef THREADS
#endif
#ifdef GLOBALMEMCTX
#endif
#ifdef SOLARIS
#endif
#ifdef THREADS
#else
#endif
return (0);
}