Refer to the heap/gameheap/gameheap_appcode.cpp
documentation.
#pragma once
#ifndef SAMPLES_SOURCES_HEAP_GAMEHEAP_GAMEHEAP_H_
#define SAMPLES_SOURCES_HEAP_GAMEHEAP_GAMEHEAP_H_
class HeapMgr;
class HeapHandle {
public:
static HeapHandle CreateHeap(
void* mem,
size_t size)
NLIB_NOEXCEPT;
idx_ = rhs.idx_;
return *this;
}
private:
int32_t idx_;
friend class HeapMgr;
friend
void SetThreadDefaultHeapHandle(HeapHandle h)
NLIB_NOEXCEPT;
friend
bool operator==(const HeapHandle& lhs, const HeapHandle& rhs)
NLIB_NOEXCEPT;
friend
bool operator!=(const HeapHandle& lhs, const HeapHandle& rhs)
NLIB_NOEXCEPT;
};
inline
bool operator==(const HeapHandle& lhs, const HeapHandle& rhs)
NLIB_NOEXCEPT {
return lhs.idx_ == rhs.idx_;
}
return lhs.idx_ != rhs.idx_;
}
class IDisposer {
public:
this->~IDisposer();
}
HeapHandle GetHeapHandle() const
NLIB_NOEXCEPT {
return handle_; }
protected:
handle_.Free(this);
}
private:
HeapHandle handle_;
};
#endif // SAMPLES_SOURCES_HEAP_GAMEHEAP_GAMEHEAP_H_