00001 /* 00002 ** (c) 1996-2000 The Regents of the University of California (through 00003 ** E.O. Lawrence Berkeley National Laboratory), subject to approval by 00004 ** the U.S. Department of Energy. Your use of this software is under 00005 ** license -- the license agreement is attached and included in the 00006 ** directory as license.txt or you may contact Berkeley Lab's Technology 00007 ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. 00008 ** The Software was developed under funding from the U.S. Government 00009 ** which consequently retains certain rights as follows: the 00010 ** U.S. Government has been granted for itself and others acting on its 00011 ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the 00012 ** Software to reproduce, prepare derivative works, and perform publicly 00013 ** and display publicly. Beginning five (5) years after the date 00014 ** permission to assert copyright is obtained from the U.S. Department of 00015 ** Energy, and subject to any subsequent five (5) year renewals, the 00016 ** U.S. Government is granted for itself and others acting on its behalf 00017 ** a paid-up, nonexclusive, irrevocable, worldwide license in the 00018 ** Software to reproduce, prepare derivative works, distribute copies to 00019 ** the public, perform publicly and display publicly, and to permit 00020 ** others to do so. 00021 */ 00022 00023 #ifndef BL_ARENA_H 00024 #define BL_ARENA_H 00025 // 00026 // $Id: Arena.H,v 1.14 2001/10/23 17:01:02 lijewski Exp $ 00027 // 00028 00029 #if defined(BL_OLD_STL) 00030 #include <stddef.h> 00031 #else 00032 #include <cstddef> 00033 #endif 00034 00035 class Arena; 00036 00037 namespace BoxLib 00038 { 00039 Arena* The_Arena (); 00040 00041 Arena* ResetArena (Arena*); 00042 } 00043 00044 // 00045 // : 00047 00055 class Arena 00056 { 00057 public: 00058 virtual ~Arena (); 00059 00063 virtual void* alloc (size_t sz) = 0; 00064 00068 virtual void free (void* pt) = 0; 00069 00075 static size_t align (size_t sz); 00076 00077 protected: 00078 // 00079 // Types used by align(). 00080 // 00081 union Word 00082 { 00083 void* p; 00084 double d; 00085 long l; 00086 void (*f) (); 00087 }; 00088 }; 00089 00090 #endif /*BL_ARENA_H*/