Browse Source

Revert usage of unique_ptr - error.

Kim Kulling 2 years ago
parent
commit
94905d445f
1 changed files with 7 additions and 8 deletions
  1. 7 8
      code/Common/StackAllocator.h

+ 7 - 8
code/Common/StackAllocator.h

@@ -60,21 +60,21 @@ namespace Assimp {
 */
 */
 class StackAllocator {
 class StackAllocator {
 public:
 public:
-    // Constructs the allocator
+    /// @brief Constructs the allocator
     inline StackAllocator();
     inline StackAllocator();
-    // Destructs the allocator and frees all memory
+    /// @brief Destructs the allocator and frees all memory
     inline ~StackAllocator();
     inline ~StackAllocator();
 
 
     // non copyable
     // non copyable
     StackAllocator(const StackAllocator &) = delete;
     StackAllocator(const StackAllocator &) = delete;
     StackAllocator &operator=(const StackAllocator &) = delete;
     StackAllocator &operator=(const StackAllocator &) = delete;
 
 
-    // Returns a pointer to byteSize bytes of heap memory that persists
-    // for the lifetime of the allocator (or until FreeAll is called).
+    /// @brief Returns a pointer to byteSize bytes of heap memory that persists
+    ///        for the lifetime of the allocator (or until FreeAll is called).
     inline void *Allocate(size_t byteSize);
     inline void *Allocate(size_t byteSize);
 
 
-    // Releases all the memory owned by this allocator.
-    // Memory provided through function Allocate is not valid anymore after this function has been called.
+    /// @brief Releases all the memory owned by this allocator.
+    //         Memory provided through function Allocate is not valid anymore after this function has been called.
     inline void FreeAll();
     inline void FreeAll();
 
 
 private:
 private:
@@ -82,8 +82,7 @@ private:
     constexpr const static size_t g_startBytesPerBlock = 16 * 1024;  // Size of the first block. Next blocks will double in size until maximum size of g_maxBytesPerBlock
     constexpr const static size_t g_startBytesPerBlock = 16 * 1024;  // Size of the first block. Next blocks will double in size until maximum size of g_maxBytesPerBlock
     size_t m_blockAllocationSize = g_startBytesPerBlock; // Block size of the current block
     size_t m_blockAllocationSize = g_startBytesPerBlock; // Block size of the current block
     size_t m_subIndex = g_maxBytesPerBlock; // The current byte offset in the current block
     size_t m_subIndex = g_maxBytesPerBlock; // The current byte offset in the current block
-    std::vector<std::unique_ptr<uint8_t[]>> m_storageBlocks;
-    //std::vector<uint8_t *> m_storageBlocks;  // A list of blocks
+    std::vector<uint8_t *> m_storageBlocks;  // A list of blocks
 };
 };
 
 
 } // namespace Assimp
 } // namespace Assimp