eclipse-iceoryx / eclipse-iceoryx/iceoryx
Introduce ManagedMemory struct to simplify allocator usage
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 492
- Avg merge
- 18h 57m
- Merged PRs (30d)
- 1
Description
## Brief feature description
Using the `BumpAllocator` usually follows the pattern
```cxx
uint8_t memory[MEMORY_SIZE]; // create some memory
BumpAllocator memoryAllocator{memory, MEMORY_SIZE}; // use the allocator
```
The same is likely to be true for future allocators. This could be combined in a [struct](https://github.com/eclipse-iceoryx/iceoryx/pull/1820#discussion_r1064619210) like
```cxx
template
class ManagedMemory {
public:
ManagedMemory() : allocator{&this->memory, MEMORY_SIZE} {}
BumpAllocator& allocator();
private:
uint8_t memory[MEMORY_SIZE];
BumpAllocator allocator;
}
```
Contributor guide
Research direction
Start by locating BumpAllocator and its current usage patterns in the repository. Review how allocator ownership and initialization are handled, then determine where ManagedMemory belongs. Done means a reusable ManagedMemory template combines the backing buffer with its allocator without breaking existing allocator usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100