16 #define DEFINE_BENTLEY_NEW_DELETE_OPERATORS\
17 void* operator new(size_t size) { return bentleyAllocator_new(size); }\
18 void operator delete(void *rawMemory, size_t size) { bentleyAllocator_delete(rawMemory, size); }
21 #if !defined (BENTLEYALLOCATOR_EXPORT)
22 #define BENTLEYALLOCATOR_EXPORT IMPORT_ATTRIBUTE
46 enum AllocationType {TopDown=1, Commit=2, Reserve=4, CommitTopDown=Commit|TopDown};
50 BENTLEYDLL_EXPORT static void* Alloc (
void*,
size_t numBytes, AllocationType, Protection);
101 template<
class _Other>
106 template<
class _Other>
124 return (allocate(_Count));
129 new((
void*)_Ptr)_Ty(_Val);
140 return (0 < _Count ? _Count : 1);
145 template<
class _Ty,
class _Other>
151 template <
class _Ty,
class _Other>
void * bentleyAllocator_malloc(size_t)
#define BENTLEYDLL_EXPORT
Definition: Bentley.h:249
void bentleyAllocator_free(void *, size_t)
Protection
Definition: BentleyAllocator.h:47
#define BENTLEYALLOCATOR_EXPORT
Definition: BentleyAllocator.h:22
_Ty const * const_pointer
Definition: BentleyAllocator.h:73
pointer allocate(size_type _Count, typename std::allocator< void >::const_pointer)
Definition: BentleyAllocator.h:122
pointer address(reference _Val) const
Definition: BentleyAllocator.h:83
void bentleyAllocator_delete(void *, size_t)
size_type max_size() const
Definition: BentleyAllocator.h:137
BentleyAllocator(const BentleyAllocator< _Ty > &)
Definition: BentleyAllocator.h:97
void bentleyAllocator_enableLowFragmentationCRTHeap()
_Ty value_type
Definition: BentleyAllocator.h:70
BentleyAllocator()
Definition: BentleyAllocator.h:93
BentleyAllocator< _Ty > & operator=(const BentleyAllocator< _Other > &)
Definition: BentleyAllocator.h:107
void deallocate(pointer _Ptr, size_type _Size)
Definition: BentleyAllocator.h:112
pointer allocate(size_type _Count)
Definition: BentleyAllocator.h:117
void construct(pointer _Ptr, const _Ty &_Val)
Definition: BentleyAllocator.h:127
_Ty * pointer
Definition: BentleyAllocator.h:71
#define BEGIN_BENTLEY_NAMESPACE
Definition: Bentley.r.h:24
_Ty const & const_reference
Definition: BentleyAllocator.h:74
Definition: BentleyAllocator.h:78
void * bentleyAllocator_new(size_t)
std::ptrdiff_t difference_type
Definition: BentleyAllocator.h:76
BentleyStatus
Definition: Bentley.h:208
Open for both read and write.
int32_t Int32
Definition: Bentley.r.h:119
Defines typedefs and constants that can be used across other namespaces. All Bentley-authored C++ sou...
const_pointer address(const_reference _Val) const
Definition: BentleyAllocator.h:88
std::size_t size_type
Definition: BentleyAllocator.h:75
bool operator!=(const BentleyAllocator< _Ty > &, const BentleyAllocator< _Other > &)
Definition: BentleyAllocator.h:152
FreeType
Definition: BentleyAllocator.h:48
#define END_BENTLEY_NAMESPACE
Definition: Bentley.r.h:25
void destroy(pointer _Ptr)
Definition: BentleyAllocator.h:132
Utility functions for managing virtual memory.
Definition: BentleyAllocator.h:44
_Ty & reference
Definition: BentleyAllocator.h:72
BentleyAllocator< _Other > other
Definition: BentleyAllocator.h:80
void * bentleyAllocator_realloc(void *, size_t)
void * bentleyAllocator_getNullRefBuffer()
An STL-compliant allocator that calls bentleyAllocator_malloc and bentleyAllocator_free.
Definition: BentleyAllocator.h:67
BentleyAllocator(const BentleyAllocator< _Other > &)
Definition: BentleyAllocator.h:102
AllocationType
Definition: BentleyAllocator.h:46
bool operator==(const BentleyAllocator< _Ty > &, const BentleyAllocator< _Other > &)
Definition: BentleyAllocator.h:146