Changeset 1238 for pjproject/trunk/pjlib/src/pjlib-test/pool_perf.c
- Timestamp:
- May 1, 2007 10:42:22 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pjlib-test/pool_perf.c
r974 r1238 61 61 } 62 62 63 /* Symbian doesn't have malloc()/free(), so we use new/delete instead */ 64 #if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0 65 66 static int pool_test_malloc_free() 67 { 68 int i; /* must be signed */ 69 70 for (i=0; i<COUNT; ++i) { 71 p[i] = new char[sizes[i]]; 72 if (!p[i]) { 73 PJ_LOG(3,(THIS_FILE," error: malloc failed to allocate %d bytes", 74 sizes[i])); 75 --i; 76 while (i >= 0) 77 delete [] p[i], --i; 78 return -1; 79 } 80 *p[i] = '\0'; 81 } 82 83 for (i=0; i<COUNT; ++i) { 84 delete [] p[i]; 85 } 86 87 return 0; 88 } 89 90 #else /* PJ_SYMBIAN */ 91 63 92 static int pool_test_malloc_free() 64 93 { … … 84 113 return 0; 85 114 } 115 116 #endif /* PJ_SYMBIAN */ 86 117 87 118 int pool_perf_test() … … 141 172 else 142 173 best = pool_time2, worst = pool_time; 174 175 /* avoid division by zero */ 176 if (best==0) best=1; 177 if (worst==0) worst=1; 143 178 144 179 PJ_LOG(3, (THIS_FILE, "..pool speedup over malloc best=%dx, worst=%dx",
Note: See TracChangeset
for help on using the changeset viewer.