aligator  0.16.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Loading...
Searching...
No Matches
mimalloc-resource.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include <memory_resource>
5
6namespace aligator {
7
9class mimalloc_resource : public std::pmr::memory_resource {
10public:
11 mimalloc_resource() = default;
12
13private:
14 [[nodiscard]] void *do_allocate(size_t bytes, size_t alignment) override;
15
16 void do_deallocate(void *ptr, size_t bytes, size_t alignment) override;
17
18 bool do_is_equal(const memory_resource &other) const noexcept override {
19 // Check if 'other' is also a mimalloc_resource
20 return dynamic_cast<const mimalloc_resource *>(&other) != nullptr;
21 }
22};
23
24} // namespace aligator
Main package namespace.