Alphabetical Class Index   Class Hierarchy   Compound Members   File Members   File List  

BStreamMemory.h

00001 //
00002 // Copyright (c) 2000 by Tech Soft 3D, LLC.
00003 // The information contained herein is confidential and proprietary to
00004 // Tech Soft 3D, LLC., and considered a trade secret as defined under
00005 // civil and criminal statutes.  Tech Soft 3D shall pursue its civil
00006 // and criminal remedies in the event of unauthorized use or misappropriation
00007 // of its trade secrets.  Use of this information by anyone other than
00008 // authorized employees of Tech Soft 3D, LLC. is granted only under a
00009 // written non-disclosure agreement, expressly prescribing the scope and
00010 // manner of such use.
00011 //
00012 // $Id: 87d70a9802e9d6488d1956828cbbaa687f8ac99b $
00013 //
00014 
00015 
00016 #ifndef BSTREAM_MEMORY
00017 #define BSTREAM_MEMORY
00018 
00019 #ifdef HPS_CORE_BUILD
00020 #   include "hoops.h"
00021 #   define BSTREAM_NEW(type)                    NEW(type)
00022 #   define BSTREAM_ALLOC(p, type)               ALLOC(p, type)
00023 #   define BSTREAM_ALLOC_ARRAY(p, count, type)  ALLOC_ARRAY(p, count, type)
00024 #   define BSTREAM_FREE(p, type) do { \
00025             if (p != null) \
00026                 FREE(p, type); \
00027             } while (0)
00028 #   define BSTREAM_FREE_ARRAY(p, count, type) do { \
00029             if (p != null) \
00030                 FREE_ARRAY(p, count, type); \
00031             } while (0)
00032 #   define BSTREAM_NEW_VLIST(p)                 p = new_vlist(HOOPS::WORLD->memory_pool)
00033 #   define BSTREAM_NEW_VHASH(p, size)           p = new_vhash(size, HOOPS::WORLD->memory_pool)
00034 #else
00035 #   define BSTREAM_NEW(type)                    new type
00036 #   define BSTREAM_ALLOC(p, type)               p = new type
00037 #   define BSTREAM_ALLOC_ARRAY(p, count, type)  p = new type [count]
00038 #   define BSTREAM_FREE(p, type)                delete p
00039 #   define BSTREAM_FREE_ARRAY(p, count, type)   delete [] p
00040 #   define BSTREAM_NEW_VLIST(p)                 p = new_vlist(malloc, free)
00041 #   define BSTREAM_NEW_VHASH(p, size)           p = new_vhash(size, malloc, free)
00042 #endif
00043 
00044 #   define BSTREAM_DELETE(p)                    delete p
00045 
00046 #endif // BSTREAM_MEMORY