23 fprintf(stderr,
"%s", errorStr);
27 int main(
int argc,
char *argv[])
49 fprintf(stderr,
"\n*** Simple memory test\n|\n");
59 int blocksize = 10000;
62 printf(
"|--* Allocating block %d\n", i);
63 sprintf(tagstring,
"Memblock no. %d : ", i);
76 fprintf(stderr,
"|--* Memory test FAILED\n|\n");
79 fprintf(stderr,
"|--* Memory tested as good (as it should be)\n|\n");
94 int blocksize = 10000;
97 printf(
"|--* Allocating block %d\n", i);
98 sprintf(tagstring,
"Memblock no. %d : ", i);
103 ip = (
int *)p[5] - 50;
104 for (i = 0; i < 1000; i++, ip++)
112 error_status |= !retval;
115 fprintf(stderr,
"|--* Memory test failed (as it should be)\n");
118 fprintf(stderr,
"|--* Memory test FAILED to find corrupted blocks \n");
127 fprintf(stderr,
"|--* Memory was corrupted\n");
132 fprintf(stderr,
"|\n|--* Errors were detected\n");
135 fprintf(stderr,
"|\n|--* Test exited successfully\n");
138 fprintf(stderr,
"|\n*** Finished test\n\n");
Read Guarded memory(de)allocation.
void(* MEM_freeN)(void *vmemh)
void(* MEM_set_error_callback)(void(*func)(const char *))
bool(* MEM_consistency_check)(void)
void *(* MEM_callocN)(size_t len, const char *str)
void(* MEM_printmemlist)(void)
int main(int argc, char *argv[])
static void mem_error_cb(const char *errorStr)