-
Notifications
You must be signed in to change notification settings - Fork 10
Split containers hpp #731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Split containers hpp #731
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #pragma once | ||
|
|
||
| #include <plf_colony.h> | ||
|
|
||
| #include <foonathan/memory/default_allocator.hpp> | ||
| #include <foonathan/memory/std_allocator.hpp> | ||
|
|
||
| #include "MemoryTracker.hpp" | ||
|
|
||
| namespace OpenVic::memory { | ||
| template<typename T, class RawAllocator = foonathan::memory::default_allocator> | ||
| using colony = plf::colony<T, foonathan::memory::std_allocator<T, tracker<RawAllocator>>>; | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||
| #pragma once | ||||||
|
|
||||||
| #include <foonathan/memory/default_allocator.hpp> | ||||||
| #include <foonathan/memory/std_allocator.hpp> | ||||||
|
|
||||||
| #include "openvic-simulation/types/CowPtr.hpp" | ||||||
| #include "MemoryTracker.hpp" | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| namespace OpenVic::memory { | ||||||
| template<typename T, class RawAllocator = foonathan::memory::default_allocator> | ||||||
| using cow_ptr = cow_ptr<T, foonathan::memory::std_allocator<T, tracker<RawAllocator>>>; | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||
| #pragma once | ||||||
|
|
||||||
| #include <foonathan/memory/default_allocator.hpp> | ||||||
| #include <foonathan/memory/std_allocator.hpp> | ||||||
|
|
||||||
| #include "openvic-simulation/types/CowVector.hpp" | ||||||
| #include "MemoryTracker.hpp" | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| namespace OpenVic::memory { | ||||||
| template<typename T, class RawAllocator = foonathan::memory::default_allocator> | ||||||
| using cow_vector = cow_vector<T, foonathan::memory::std_allocator<T, tracker<RawAllocator>>>; | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||
| #pragma once | ||||||
|
|
||||||
| #include <scoped_allocator> | ||||||
|
|
||||||
| #include <foonathan/memory/config.hpp> | ||||||
| #include <foonathan/memory/std_allocator.hpp> | ||||||
|
|
||||||
| #include "openvic-simulation/core/portable/Deque.hpp" | ||||||
| #include "MemoryTracker.hpp" | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| namespace OpenVic::memory { | ||||||
| template<typename T, class RawAllocator = foonathan::memory::default_allocator> | ||||||
| FOONATHAN_ALIAS_TEMPLATE( | ||||||
| deque, | ||||||
| OpenVic::utility::deque< | ||||||
| T, | ||||||
| foonathan::memory::std_allocator<T, tracker<RawAllocator>> | ||||||
| > | ||||||
| ); | ||||||
|
|
||||||
| template<typename T, class RawAllocator = foonathan::memory::default_allocator> | ||||||
| FOONATHAN_ALIAS_TEMPLATE( | ||||||
| deque_scoped_alloc, | ||||||
| OpenVic::utility::deque< | ||||||
| T, | ||||||
| std::scoped_allocator_adaptor<foonathan::memory::std_allocator<T, tracker<RawAllocator>>> | ||||||
| > | ||||||
| ); | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||
| #pragma once | ||||||
|
|
||||||
| #include <fmt/base.h> | ||||||
| #include <fmt/format.h> | ||||||
|
|
||||||
| #include <foonathan/memory/default_allocator.hpp> | ||||||
|
|
||||||
| #include "MemoryTracker.hpp" | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| #include "String.hpp" | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| namespace OpenVic::memory { | ||||||
| namespace fmt { | ||||||
| template<typename T, class RawAllocator = foonathan::memory::default_allocator> | ||||||
| using basic_memory_buffer = ::fmt::basic_memory_buffer< | ||||||
| T, | ||||||
| ::fmt::inline_buffer_size, | ||||||
| foonathan::memory::std_allocator< | ||||||
| T, | ||||||
| OpenVic::memory::tracker<RawAllocator> | ||||||
| > | ||||||
| >; | ||||||
|
|
||||||
| inline static memory::string vformat(::fmt::string_view fmt, ::fmt::format_args args) { | ||||||
| memory::fmt::basic_memory_buffer<char> buf {}; | ||||||
| ::fmt::vformat_to(std::back_inserter(buf), fmt, args); | ||||||
| return memory::string(buf.data(), buf.size()); | ||||||
| } | ||||||
|
|
||||||
| template<typename... Args> | ||||||
| memory::string format(::fmt::string_view fmt, const Args&... args) { | ||||||
| return memory::fmt::vformat(fmt, ::fmt::make_format_args(args...)); | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||
| #pragma once | ||||||
|
|
||||||
| #include <queue> | ||||||
|
|
||||||
| #include "Deque.hpp" | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| namespace OpenVic::memory { | ||||||
| template<typename T, typename Container = memory::deque<T>> | ||||||
| using queue = std::queue<T, Container>; | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.