Skip to content

Commit

Permalink
Fix virtual class override
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 committed Nov 16, 2024
1 parent 1541328 commit 14cab6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dart/common/MemoryAllocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class MemoryAllocator : public Castable<MemoryAllocator>

/// Allocates \c size bytes of uninitialized storage.
///
/// \param[in] bytes: The byte size to allocate sotrage for.
/// \param[in] bytes: The byte size to allocate storage for.
/// \return On success, the pointer to the beginning of newly allocated
/// memory.
/// \return On failure, a null pointer
Expand Down
12 changes: 6 additions & 6 deletions dart/common/MemoryManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace dart::common {

/// A composite memory allocator that contains various memory allocators that
/// are optimized for different use cases.
class MemoryManager final : public MemoryAllocator
class MemoryManager : public MemoryAllocator
{
public:
/// Type of the memory allocators
Expand Down Expand Up @@ -80,26 +80,26 @@ class MemoryManager final : public MemoryAllocator
/// Allocates \c size bytes of uninitialized storage.
///
/// \param[in] type: The memory allocator type.
/// \param[in] bytes: The byte size to allocate sotrage for.
/// \param[in] bytes: The byte size to allocate storage for.
/// \return On success, the pointer to the beginning of newly allocated
/// memory.
/// \return On failure, a null pointer
[[nodiscard]] void* allocate(Type type, size_t bytes);

/// Allocates using base allocator
[[nodiscard]] void* allocate(size_t bytes) noexcept final;
[[nodiscard]] void* allocate(size_t bytes) noexcept override;

/// Allocates \c size bytes of uninitialized storage using FreeListAllocator.
///
/// \param[in] bytes: The byte size to allocate sotrage for.
/// \param[in] bytes: The byte size to allocate storage for.
/// \return On success, the pointer to the beginning of newly allocated
/// memory.
/// \return On failure, a null pointer
[[nodiscard]] void* allocateUsingFree(size_t bytes);

/// Allocates \c size bytes of uninitialized storage using PoolAllocator.
///
/// \param[in] bytes: The byte size to allocate sotrage for.
/// \param[in] bytes: The byte size to allocate storage for.
/// \return On success, the pointer to the beginning of newly allocated
/// memory.
/// \return On failure, a null pointer
Expand All @@ -115,7 +115,7 @@ class MemoryManager final : public MemoryAllocator
// TODO(JS): Make this constexpr once migrated to C++20

/// Deallocates using base allocator
void deallocate(void* pointer, size_t bytes) final;
void deallocate(void* pointer, size_t bytes) override;

void deallocateUsingFree(void* pointer, size_t bytes);

Expand Down
2 changes: 1 addition & 1 deletion dart/common/StlAllocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class StlAllocator : public std::allocator<T>

/// Allocates n * sizeof(T) bytes of uninitialized storage.
///
/// \param[in] n: The number of objects to allocate sotrage for.
/// \param[in] n: The number of objects to allocate storage for.
/// \param[in] hint: Point to a nearby memory location.
/// \return On success, the pointer to the beginning of newly allocated
/// memory.
Expand Down

0 comments on commit 14cab6a

Please sign in to comment.