All Questions
16
questions
0
votes
1
answer
155
views
Multiple containers share a single memory resource
In my project, I'm trying to use the std::pmr allocator and monotonic_buffer_resource. I'm using vector in various classes, and ...
2
votes
3
answers
350
views
Fixed-size memory allocator
I've been trying to implement a simple Boost PMR allocator that has a fixed amount of memory. My first implementation (which can be found here) had undefined behavior and did not handle memory ...
5
votes
2
answers
836
views
C++ Garbage Collector - Simple Automatic Memory Management
I made a general smart pointer which fixes the problems of loops between std::shared_ptr's. While use is simple, I feel that my code is inefficient and clumsy. Here ...
4
votes
2
answers
567
views
"observer pointer" meant to stay updated when the pointed object is moved in memory
I wasn't sure about how to name it, maybe "follow_ptr", "self_updating_ptr", or "stalking_ptr" or something on those lines. For now it's called Identifier.
What I'm ...
3
votes
1
answer
2k
views
A custom memory allocator in c++
Recently I became interested in implementing a FORTH language interpreter. That led me to read about memory models etc.
which led me to write this custom memory allocator in c++. It's very dumb as ...
11
votes
1
answer
1k
views
Customization of memory class C++
I have implemented a customized memory allocation class template for an assignment. Codes are commented; Hopefully it's clear. I would love to know if there is any way to make the code more optimized.
...
1
vote
1
answer
320
views
Custom bounded memory pool allocator
Recently I put together a custom fixed size (bounded) memory pool for my job system implementation to support its internal memory management. Since it will be accessed by different threads I want to ...
10
votes
1
answer
2k
views
Static block memory allocator
I've found a little task to create a block memory pool allocator. This allocator is required to allocate memory in single fixed-sized blocks from the pool in static memory. Sizes of block and pool are ...
4
votes
1
answer
484
views
Single-thread Task Scheduler with type erasure and allocator-aware
I made a task scheduler to practice allocators and type erasure. With my project, you can delay execution of any callable (functions (using std::ref), lambdas...) ...
8
votes
1
answer
833
views
A fixed-size dynamic array
Background
I implemented the historic std::dynarray according to the specification under the name dynamic_array in C++17. ...
2
votes
0
answers
50
views
Fixed Size Resource Array with Versioned Indexes
I'm trying to implement a fixed sized array that uses versioned keys for dangling safety. This structure is similar to a slot map data structure, with the exception that this does not automatically ...
3
votes
1
answer
963
views
Implementation of static_vector using an array of std::aligned_storage, with std::launder and forwarding
I'm trying to expand on the implementation of static_vector on the std::aligned_storage reference page, but would like to split it into two parts. First, an ...
8
votes
1
answer
119
views
Tracker for object construction, copy, and movement
I made an object tracker for debugging and testing purposes called ccm_counter (construction, copy, move counter). It counts constructor, copy and move calls. It ...
2
votes
1
answer
528
views
Deep-copyable unique_ptr wrapper with std::visit-like feature
I'm writing a simple wrapper for std::unique_ptr, which copies the pointed object when copied.
Unlike this wrapper, it properly copies derived classes if
...
3
votes
1
answer
104
views
Pre-baked Hash table with a flat memory layout
A few notes:
There is currently no non exception-based way of knowing whether a key is present in the table or not. This is intentional for my use case.
Unlike the lookup process, the baking process ...