Alphabetical Class Index   Class Hierarchy   Compound Members   File Members   File List  

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