From 49b058066db4e2b4e78b9f7924dd3795a024d94a Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 7 Nov 2013 11:19:35 +0100 Subject: [PATCH] Increase junkarea to 4kiB. --- src/xbt/mmalloc/mm_legacy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/xbt/mmalloc/mm_legacy.c b/src/xbt/mmalloc/mm_legacy.c index b202c9b9be..2a1a5863ce 100644 --- a/src/xbt/mmalloc/mm_legacy.c +++ b/src/xbt/mmalloc/mm_legacy.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2012. The SimGrid Team. +/* Copyright (c) 2010-2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -55,7 +55,7 @@ static void mm_gnuld_legacy_init(void) { /* This function is called from mmalloc * To that extend, we have a little area here living in .BSS that we return if asked for memory before the malloc is resolved. */ int allocated_junk=0; /* keep track of whether our little area was already given to someone */ -char junkarea[512]; +char junkarea[4096]; /* This version use mmalloc if there is a current heap, or the legacy implem if not */ void *malloc(size_t n) { @@ -83,10 +83,10 @@ void *malloc(size_t n) { "Panic: real malloc symbol not resolved yet, and I already gave my little private memory chunk away. " "Damn LD, we must extend our code to have several such areas.\n"); exit(1); - } else if (n>512) { + } else if (n > sizeof junkarea) { fprintf(stderr, - "Panic: real malloc symbol not resolved yet, and I need %zu bytes while my little private memory chunk is only 512 bytes wide. " - "Damn LD, we must fix our code to extend this area.\n",n); + "Panic: real malloc symbol not resolved yet, and I need %zu bytes while my little private memory chunk is only %zu bytes wide. " + "Damn LD, we must fix our code to extend this area.\n", n, sizeof junkarea); exit(1); } else { allocated_junk = 1; -- 2.20.1