From fb23590413b48823fe65ba22b88e36253ae9f784 Mon Sep 17 00:00:00 2001 From: mquinson Date: Thu, 15 Oct 2009 11:53:55 +0000 Subject: [PATCH] malloc the expected size (and announce the malloced size) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6780 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- examples/gras/replay/xbt_workload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/gras/replay/xbt_workload.c b/examples/gras/replay/xbt_workload.c index 1dbdff7837..23bbffe6f5 100644 --- a/examples/gras/replay/xbt_workload.c +++ b/examples/gras/replay/xbt_workload.c @@ -184,8 +184,8 @@ void xbt_workload_declare_datadesc(void) { xbt_workload_data_chunk_t xbt_workload_data_chunk_new(int size) { xbt_workload_data_chunk_t res = xbt_new0(s_xbt_workload_data_chunk_t,1); - res->size = size; - res->chunk = xbt_new(char,size-sizeof(res)-sizeof(int)); + res->size = size-sizeof(res)-sizeof(int); + res->chunk = xbt_new(char,res->size); return res; } void xbt_workload_data_chunk_free(xbt_workload_data_chunk_t c) { -- 2.20.1