aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetSlab/src/slab.cc
diff options
context:
space:
mode:
authorschnetter <>2003-02-28 08:56:00 +0000
committerschnetter <>2003-02-28 08:56:00 +0000
commitd108aaf6a4337af589a717915d06f76eb822054a (patch)
tree1148d95cab0b5c31c9a49df2bbd7b119d27f5fa5 /Carpet/CarpetSlab/src/slab.cc
parent77de3e55355912c0083f41176722c2663aeb1e23 (diff)
Removed dependence on alloca, which isn't standard and isn't supported
Removed dependence on alloca, which isn't standard and isn't supported on all systems. darcs-hash:20030228085604-07bb3-f55515e91912d6e5f696cb669d08ccbd4d7a1bef.gz
Diffstat (limited to 'Carpet/CarpetSlab/src/slab.cc')
-rw-r--r--Carpet/CarpetSlab/src/slab.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/Carpet/CarpetSlab/src/slab.cc b/Carpet/CarpetSlab/src/slab.cc
index f11cfa4f0..6a0eff994 100644
--- a/Carpet/CarpetSlab/src/slab.cc
+++ b/Carpet/CarpetSlab/src/slab.cc
@@ -1,6 +1,5 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetSlab/src/slab.cc,v 1.2 2003/01/03 15:49:36 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetSlab/src/slab.cc,v 1.3 2003/02/28 09:56:04 schnetter Exp $
-#include <alloca.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
@@ -20,7 +19,7 @@
#include "slab.hh"
extern "C" {
- static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetSlab/src/slab.cc,v 1.2 2003/01/03 15:49:36 schnetter Exp $";
+ static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetSlab/src/slab.cc,v 1.3 2003/02/28 09:56:04 schnetter Exp $";
CCTK_FILEVERSION(Carpet_CarpetSlab_slab_cc);
}
@@ -261,7 +260,7 @@ namespace CarpetSlab {
assert (hsize);
// Calculate more convenient representation of the direction
- int* const dirs = (int*)alloca(hdim * sizeof(int));
+ int* const dirs = new int [hdim];
// The following if statement is written according to the
// definition of "dir".
if (hdim==1) {
@@ -347,6 +346,9 @@ namespace CarpetSlab {
downsample,
hsize);
+ // Release memory
+ delete [] dirs;
+
// Return with success
return 1;
}