aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@b61c5cb5-eaca-4651-9a7a-d64986f99364>2005-02-19 13:03:40 +0000
committerschnetter <schnetter@b61c5cb5-eaca-4651-9a7a-d64986f99364>2005-02-19 13:03:40 +0000
commit28cb74923985e842de6b80c227ccb6cedf28ce70 (patch)
tree3b76942b6ea490fd500ed029030b914b32b9397c
parenta9b6d34b0afab8060d2eaeeb5a88b59349b6f30e (diff)
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
-rw-r--r--src/Storage.c6
1 files 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 "