16 #ifndef SAMPLES_SOURCES_HEAP_GAMEHEAP_GAMEHEAP_H_ 17 #define SAMPLES_SOURCES_HEAP_GAMEHEAP_GAMEHEAP_H_ 25 static HeapHandle CreateHeap(
void* mem,
size_t size)
NLIB_NOEXCEPT;
28 HeapHandle() NLIB_NOEXCEPT : idx_(0) {}
29 HeapHandle(
const HeapHandle& h)
NLIB_NOEXCEPT : idx_(h.idx_) {}
30 HeapHandle& operator=(
const HeapHandle& rhs) NLIB_NOEXCEPT {
35 void* Alloc(
size_t size,
size_t alignment = 8) NLIB_NOEXCEPT;
36 void Free(
void* ptr) NLIB_NOEXCEPT;
38 void FreeAll() NLIB_NOEXCEPT;
46 bool IsValid() NLIB_NOEXCEPT;
47 bool IsClean() NLIB_NOEXCEPT;
50 explicit HeapHandle(
int h) NLIB_NOEXCEPT : idx_(h) {}
54 friend HeapHandle GetThreadDefaultHeapHandle() NLIB_NOEXCEPT;
55 friend
void SetThreadDefaultHeapHandle(HeapHandle h) NLIB_NOEXCEPT;
56 friend
bool operator==(const HeapHandle& lhs, const HeapHandle& rhs) NLIB_NOEXCEPT;
57 friend
bool operator!=(const HeapHandle& lhs, const HeapHandle& rhs) NLIB_NOEXCEPT;
60 inline
bool operator==(const HeapHandle& lhs, const HeapHandle& rhs) NLIB_NOEXCEPT {
61 return lhs.idx_ == rhs.idx_;
64 inline bool operator!=(
const HeapHandle& lhs,
const HeapHandle& rhs) NLIB_NOEXCEPT {
65 return lhs.idx_ != rhs.idx_;
73 HeapHandle GetThreadDefaultHeapHandle() NLIB_NOEXCEPT;
74 void SetThreadDefaultHeapHandle(HeapHandle h) NLIB_NOEXCEPT;
79 void Destroy() NLIB_NOEXCEPT {
84 HeapHandle GetHeapHandle() const NLIB_NOEXCEPT {
return handle_; }
87 virtual ~IDisposer() NLIB_NOEXCEPT {
97 #endif // SAMPLES_SOURCES_HEAP_GAMEHEAP_GAMEHEAP_H_ bool operator!=(const HeapHash &rhs, const HeapHash &lhs)
Returns true if the two compared summaries are not equal.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
A file that contains the configuration information for each development environment.