summaryrefslogtreecommitdiff
path: root/pjlib/src/pjlib-test/pool_perf.c
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib/src/pjlib-test/pool_perf.c')
-rw-r--r--pjlib/src/pjlib-test/pool_perf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pjlib/src/pjlib-test/pool_perf.c b/pjlib/src/pjlib-test/pool_perf.c
index 8bd5635f..d73f7a5b 100644
--- a/pjlib/src/pjlib-test/pool_perf.c
+++ b/pjlib/src/pjlib-test/pool_perf.c
@@ -127,8 +127,12 @@ int pool_perf_test()
/* Initialize size of chunks to allocate in for the test. */
for (i=0; i<COUNT; ++i) {
+ unsigned aligned_size;
sizes[i] = MIN_SIZE + (pj_rand() % MAX_SIZE);
- total_size += sizes[i];
+ aligned_size = sizes[i];
+ if (aligned_size & (PJ_POOL_ALIGNMENT-1))
+ aligned_size = ((aligned_size + PJ_POOL_ALIGNMENT - 1)) & ~(PJ_POOL_ALIGNMENT - 1);
+ total_size += aligned_size;
}
/* Add some more for pool admin area */