-
Couldn't load subscription status.
- Fork 3
Add memory allocator and a subset of smart pointers #1
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?
Conversation
Somehow git mv hasn't catch the rename huh?
This permit to get ride of the usage of the default delete keyword and the usage of a custom allocator.
|
For reference: We now have a shared_ptr/unique_ptr implementation that differ from the std counterpart. I also rewrote the memory allocator to use a simple free list (this still uses a first fit algorithm but I guess it's clearly enough for now). The doc still need to be updated and some small optimization can be done on the free list fragmentation. |
Summary
As discussed on Discord, this Pull Request mainly adds a memory allocator which is capable of mapping and managing a given memory region and implementations for
shared_ptrandunqiue_ptr.I also made the
fix_codestylescript executable under Linux and reformatted everything with Clang-Format.Goals
Adequate replacement for
std::shared_ptrandstd::unqiue_ptr.Free of dependencies.
Lightweight implementation.
Clean and fast code.
Good documentation for Doxygen.
Limitations
Neither the memory allocator nor the smart pointers can be considered thread-safe.
hs::os::Mutex.No support for heap allocations.
No implementation of
weak_ptras I didn't consider it necessary.Only a subset of the smart pointers is actually implemented.