acl/lib_acl/samples/debug_malloc/main.cpp

21 lines
377 B
C++
Raw Normal View History

#include "lib_acl.h"
2014-11-19 00:25:21 +08:00
int main(int argc acl_unused, char *argv[] acl_unused)
{
char *ptr2;
char *ptr3 = acl_mystrdup("hello world!");
int i;
acl_debug_malloc_init(NULL, "log.txt");
for (i = 0; i < 100; i++) {
(void) acl_mymalloc(100);
ptr2 = (char*) acl_mymalloc(100);
acl_myfree(ptr2);
}
acl_myfree(ptr2);
acl_myfree(ptr3);
return 0;
}