From 28cb74923985e842de6b80c227ccb6cedf28ce70 Mon Sep 17 00:00:00 2001 From: schnetter Date: Sat, 19 Feb 2005 13:03:40 +0000 Subject: Take the vector length into account when allocating storage. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@459 b61c5cb5-eaca-4651-9a7a-d64986f99364 --- src/Storage.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Storage.c b/src/Storage.c index edcc2ec..3ae2428 100644 --- a/src/Storage.c +++ b/src/Storage.c @@ -690,7 +690,7 @@ static int PUGH_EnableGArrayGroupStorage (pGH *pughGH, else if (! padding_active) { /* Easy case. */ - GA->data = malloc (GA->extras->npoints * GA->varsize); + GA->data = malloc (GA->extras->npoints * GA->varsize * GA->vector_size); GA->padddata = GA->data; } else @@ -710,10 +710,10 @@ static int PUGH_EnableGArrayGroupStorage (pGH *pughGH, if (GA->data) { PUGH_InitializeMemory (initialize_memory, GA->vtype, - GA->extras->npoints * GA->varsize, GA->data); + GA->extras->npoints * GA->varsize * GA->vector_size, GA->data); } - if (GA->extras->npoints * GA->varsize > 0 && GA->padddata == NULL) + if (GA->extras->npoints * GA->varsize * GA->vector_size > 0 && GA->padddata == NULL) { CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, "PUGH_EnableGArrayDataStorage: Cannot allocate data for " -- cgit v1.2.3