aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/data.hh
diff options
context:
space:
mode:
authorschnetter <>2004-04-08 09:16:00 +0000
committerschnetter <>2004-04-08 09:16:00 +0000
commitce4b54028e863fe0bb1517a022fe0369412454f8 (patch)
treee6bdc0fb9e99b58ee8f765d6db8e9ac64ba43e2e /Carpet/CarpetLib/src/data.hh
parent0da2cef8eccd2a2a87db35c84627caf5420be8d2 (diff)
Abort with an error message if CarpetLib cannot allocate memory for
Abort with an error message if CarpetLib cannot allocate memory for grid functions. Also track how much memory is already used. darcs-hash:20040408091635-07bb3-3385e3472c428b3aa562d6ab76f2f6ca32b77f19.gz
Diffstat (limited to 'Carpet/CarpetLib/src/data.hh')
-rw-r--r--Carpet/CarpetLib/src/data.hh9
1 files changed, 7 insertions, 2 deletions
diff --git a/Carpet/CarpetLib/src/data.hh b/Carpet/CarpetLib/src/data.hh
index b8c3e360d..b12b6c48d 100644
--- a/Carpet/CarpetLib/src/data.hh
+++ b/Carpet/CarpetLib/src/data.hh
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/data.hh,v 1.19 2004/03/23 15:37:21 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/data.hh,v 1.20 2004/04/08 11:16:35 schnetter Exp $
#ifndef DATA_HH
#define DATA_HH
@@ -31,7 +31,8 @@ class data: public gdata<D>
// Fields
T* _storage; // the data (if located on this processor)
-
+ size_t _allocated_bytes;
+
int vectorlength;
int vectorindex;
data* vectorleader;
@@ -56,6 +57,10 @@ public:
const operator_type transport_operator) const;
// Storage management
+private:
+ void getmem (const size_t nelems);
+ void freemem ();
+public:
virtual void allocate (const ibbox& extent, const int proc,
void* const mem=0);
virtual void free ();