|
@@ -64,9 +64,9 @@ namespace Assimp
|
|
class StackAllocator {
|
|
class StackAllocator {
|
|
public:
|
|
public:
|
|
// Constructs the allocator
|
|
// Constructs the allocator
|
|
- StackAllocator();
|
|
|
|
|
|
+ inline StackAllocator();
|
|
// Destructs the allocator and frees all memory
|
|
// Destructs the allocator and frees all memory
|
|
- ~StackAllocator();
|
|
|
|
|
|
+ inline ~StackAllocator();
|
|
|
|
|
|
// non copyable
|
|
// non copyable
|
|
StackAllocator(const StackAllocator &) = delete;
|
|
StackAllocator(const StackAllocator &) = delete;
|
|
@@ -74,11 +74,11 @@ public:
|
|
|
|
|
|
// Returns a pointer to byteSize bytes of heap memory that persists
|
|
// Returns a pointer to byteSize bytes of heap memory that persists
|
|
// for the lifetime of the allocator (or until FreeAll is called).
|
|
// for the lifetime of the allocator (or until FreeAll is called).
|
|
- void *Allocate(size_t byteSize);
|
|
|
|
|
|
+ inline void *Allocate(size_t byteSize);
|
|
|
|
|
|
// Releases all the memory owned by this allocator.
|
|
// Releases all the memory owned by this allocator.
|
|
// Memory provided through function Allocate is not valid anymore after this function has been called.
|
|
// Memory provided through function Allocate is not valid anymore after this function has been called.
|
|
- void FreeAll();
|
|
|
|
|
|
+ inline void FreeAll();
|
|
|
|
|
|
private:
|
|
private:
|
|
constexpr const static size_t g_maxBytesPerBlock = 64 * 1024 * 1024; // The maximum size (in bytes) of a block
|
|
constexpr const static size_t g_maxBytesPerBlock = 64 * 1024 * 1024; // The maximum size (in bytes) of a block
|
|
@@ -91,4 +91,6 @@ private:
|
|
|
|
|
|
} // namespace Assimp
|
|
} // namespace Assimp
|
|
|
|
|
|
|
|
+#include "StackAllocator.inl"
|
|
|
|
+
|
|
#endif // include guard
|
|
#endif // include guard
|