version 1.1.2.1, 2012/02/27 21:18:31
|
version 1.1.2.2, 2012/02/27 23:57:12
|
Line 6 int
|
Line 6 int
|
main(int argc, char **argv) |
main(int argc, char **argv) |
{ |
{ |
mpool_t *mp; |
mpool_t *mp; |
|
void *addr; |
|
uintptr_t blah = 4000; |
|
int i; |
|
|
|
printf("blah=%x\n", sizeof(uintptr_t) == sizeof(u_int) ? 0 : blah >> 32); |
|
|
mp = mpool_init(); |
mp = mpool_init(); |
if (!mp) { |
if (!mp) { |
printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
return 1; |
return 1; |
} |
} |
|
|
|
for (i = 0; i < 3; i++) { |
|
addr = mpool_malloc(mp, 4000, "mdaaa 4000"); |
|
if (!addr) { |
|
printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
|
mpool_destroy(&mp); |
|
return 2; |
|
} |
|
printf("addr=%p chkaddr=%d addr_size=%d\n", addr, mpool_chkaddr(addr), mpool_getsizebyaddr(addr)); |
|
|
|
strlcpy(addr, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ndddddd\n", |
|
mpool_getsizebyaddr(addr)); |
|
// mpool_free(mp, addr, 0); |
|
} |
|
|
|
mpool_purge(mp, 1); |
|
|
mpool_destroy(&mp); |
mpool_destroy(&mp); |
return 0; |
return 0; |