usermode/library/pmalloc/src/config.h

00001 
00002 //
00003 // The Hoard Multiprocessor Memory Allocator
00004 // www.hoard.org
00005 //
00006 // Author: Emery Berger, http://www.cs.utexas.edu/users/emery
00007 //
00008 // Copyright (c) 1998-2001, The University of Texas at Austin.
00009 //
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Library General Public License as
00012 // published by the Free Software Foundation, http://www.fsf.org.
00013 //
00014 // This library is distributed in the hope that it will be useful, but
00015 // WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 // Library General Public License for more details.
00018 //
00020 
00021 #ifndef _CONFIG_H_
00022 #define _CONFIG_H_
00023 
00024 #ifndef _REENTRANT
00025 #define _REENTRANT              // If defined, generate a multithreaded-capable version.
00026 #endif
00027 
00028 #ifndef USER_LOCKS
00029 #if !(defined(sparc) || defined(i386) || defined(__sgi) || defined(ppc))
00030 #define USER_LOCKS 0
00031 #else
00032 #define USER_LOCKS 1            // Use our own user-level locks if they're available for the current architecture.
00033 #endif
00034 #endif
00035 
00036 #define HEAP_LOG 0              // If non-zero, keep a log of heap accesses.
00037 
00038 
00040 
00041 #if defined(WIN32)
00042 
00043 #define _CRTIMP __declspec(dllimport)
00044 
00045 #if 0
00046 #ifndef __PLACEMENT_NEW_INLINE
00047 #define __PLACEMENT_NEW_INLINE
00048 inline void *__cdecl operator new(size_t, void *_P) { return (_P); }
00049 #if _MSC_VER >= 1200
00050 inline void __cdecl operator delete(void *, void *) { return; }
00051 #endif
00052 #endif
00053 #endif
00054 
00055 #endif
00056 
00057 // The number of groups of superblocks we maintain based on what
00058 // fraction of the superblock is empty. NB: This number must be at
00059 // least 2, and is 1 greater than the EMPTY_FRACTION in heap.h.
00060 
00061 enum { SUPERBLOCK_FULLNESS_GROUP = 9 };
00062 
00063 // A superblock that holds more than one object must hold at least
00064 // this many bytes.
00065 enum { SUPERBLOCK_SIZE = 16384 };
00066 
00067 
00068 // DO NOT CHANGE THESE.  They require running of maketable to replace
00069 // the values in heap.cpp for the _numBlocks array.
00070 
00071 #define HEAP_DEBUG 0            // If non-zero, keeps extra info for sanity checking.
00072 #define HEAP_STATS 0            // If non-zero, maintain blowup statistics.
00073 #define HEAP_FRAG_STATS 0       // If non-zero, maintain fragmentation statistics.
00074 
00075 
00076 // CACHE_LINE = The number of bytes in a cache line.
00077 
00078 #if defined(i386) || defined(WIN32)
00079 #define CACHE_LINE 32
00080 #endif
00081 
00082 #ifdef sparc
00083 #define CACHE_LINE 64
00084 #endif
00085 
00086 #ifdef __sgi
00087 #define CACHE_LINE 128
00088 #endif
00089 
00090 #ifndef CACHE_LINE
00091 // We don't know what the architecture is,
00092 // so go for the gusto.
00093 #define CACHE_LINE 64
00094 #endif
00095 
00096 #ifdef __GNUG__
00097 // Use the max operator, an extension to C++ found in GNU C++.
00098 #define MAX(a,b) ((a) >? (b))
00099 #else
00100 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
00101 #endif
00102 
00103 
00104 #endif // _CONFIG_H_
00105 

Generated on Sat Apr 23 11:43:35 2011 for Mnemosyne by  doxygen 1.4.7