Changeset 361 for pjproject/trunk/pjsip-apps/src/samples/simpleua.c
- Timestamp:
- Mar 24, 2006 8:44:27 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/samples/simpleua.c
r350 r361 62 62 #define THIS_FILE "simpleua.c" 63 63 64 #include "util.h" 64 65 65 66 /* … … 125 126 126 127 127 /*128 * Util to display the error message for the specified error code129 */130 static int app_perror( const char *sender, const char *title,131 pj_status_t status)132 {133 char errmsg[PJ_ERR_MSG_SIZE];134 135 pj_strerror(status, errmsg, sizeof(errmsg));136 137 PJ_LOG(1,(sender, "%s: %s [code=%d]", title, errmsg, status));138 return 1;139 }140 141 128 142 129 /* … … 416 403 } 417 404 418 /* On exit, dump memory usage: */ 419 { 420 pj_pool_t *p; 421 unsigned total_alloc = 0; 422 unsigned total_used = 0; 423 424 /* Accumulate memory usage in active list. */ 425 p = cp.used_list.next; 426 while (p != (pj_pool_t*) &cp.used_list) { 427 total_alloc += pj_pool_get_capacity(p); 428 total_used += pj_pool_get_used_size(p); 429 p = p->next; 430 } 431 432 printf("Total pool memory allocated=%d KB, used=%d KB\n", 433 total_alloc / 1000, 434 total_used / 1000); 435 } 405 /* On exit, dump current memory usage: */ 406 dump_pool_usage(THIS_FILE, &cp); 436 407 437 408 return 0;
Note: See TracChangeset
for help on using the changeset viewer.