3 #ifndef SAMPLES_SOURCES_HEAP_GAMEHEAP_GAMEHEAP_H_ 4 #define SAMPLES_SOURCES_HEAP_GAMEHEAP_GAMEHEAP_H_ 12 static HeapHandle createHeap(
void* mem,
size_t size)
NLIB_NOEXCEPT;
15 HeapHandle() NLIB_NOEXCEPT : idx_(0) {}
16 HeapHandle(
const HeapHandle& h) NLIB_NOEXCEPT : idx_(h.idx_) {}
17 HeapHandle& operator=(
const HeapHandle& rhs) NLIB_NOEXCEPT {
22 void* alloc(
size_t size,
size_t alignment = 8) NLIB_NOEXCEPT;
23 void free(
void* ptr) NLIB_NOEXCEPT;
25 void freeAll() NLIB_NOEXCEPT;
33 bool isValid() NLIB_NOEXCEPT;
34 bool isClean() NLIB_NOEXCEPT;
37 explicit HeapHandle(
int h) NLIB_NOEXCEPT : idx_(h) {}
41 friend HeapHandle GetThreadDefaultHeapHandle() NLIB_NOEXCEPT;
42 friend
void SetThreadDefaultHeapHandle(HeapHandle h) NLIB_NOEXCEPT;
43 friend
bool operator==(const HeapHandle& lhs, const HeapHandle& rhs) NLIB_NOEXCEPT;
44 friend
bool operator!=(const HeapHandle& lhs, const HeapHandle& rhs) NLIB_NOEXCEPT;
47 inline
bool operator==(const HeapHandle& lhs, const HeapHandle& rhs) NLIB_NOEXCEPT {
48 return lhs.idx_ == rhs.idx_;
51 inline bool operator!=(
const HeapHandle& lhs,
const HeapHandle& rhs) NLIB_NOEXCEPT {
52 return lhs.idx_ != rhs.idx_;
60 HeapHandle GetThreadDefaultHeapHandle() NLIB_NOEXCEPT;
61 void SetThreadDefaultHeapHandle(HeapHandle h) NLIB_NOEXCEPT;
65 IDisposer(HeapHandle h) NLIB_NOEXCEPT : handle_(h) {}
66 void Destroy() NLIB_NOEXCEPT {
71 HeapHandle GetHeapHandle() const NLIB_NOEXCEPT {
return handle_; }
74 virtual ~IDisposer() NLIB_NOEXCEPT {
84 #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.