From 1a34fea5ff01419b0c4c4c1ea2a7d9a97d21f428 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Sat, 30 Apr 2011 00:35:53 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=B8=D0=BD=D0=B0=D0=BC=D0=B8=D1=87?= =?UTF-8?q?=D0=B5=D1=81=D0=BA=D0=BE=D0=B5=20=D0=B2=D1=8B=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20mem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c/malloc_speed_test/pool_list.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/c/malloc_speed_test/pool_list.c b/c/malloc_speed_test/pool_list.c index b6034e7..ee6fd86 100644 --- a/c/malloc_speed_test/pool_list.c +++ b/c/malloc_speed_test/pool_list.c @@ -93,14 +93,14 @@ inline void pool_free(void *p) busy_pool = b2; } -void *mem[MAX_I]; - int main() { unsigned long long i; init(); + + void **mem = malloc(MAX_I * sizeof(void *)); for (i = 0; i < MAX_I; i++) if (!(mem[i] = pool_alloc())) { @@ -111,6 +111,8 @@ int main() for (i = 0; i < MAX_I; i++) pool_free(mem[i]); + free(mem); + return 0; }