Releases: facontidavide/Bonxai
Better memory management (and more!)
This is a very important release. If you can, you should upgrade!
Split "core" into multiple header files
I was quite happy with bonxai.hpp
being a single, self-contained header file, but as complexity grows, it is time to move to multiple files.
In future releases I may add an "amalgameted file".
Bonxai, release my memory !
While using Bonxai I realized that sometimes the application keeps using memory, even when the data structure is deleted.
Wondering if I have a memory leak, I started analyzing the app with the usual tools: valgrind, heaptrack and address sanitizers.
Everything looks fine! Still, the memory was "there".
Then, I found this article: https://lemire.me/blog/2020/03/03/calling-free-or-delete/
And "boom"! That was the problem: malloc
keeps the memory allocated when it does very small allocations! To fix this problem I now use a simplistic memory pool that allocates bigger chunks of memory.
Speed is still the same, but as expected, memory is returned to the operating system when a large VoxelGrids are deleted.
Added BinaryVoxelGrid
This is a specialization of VoxelGrid
where each cell can only be On or Off, but contains no value.
If that is your case, this BinaryVoxelGrid
will use considerably less memory!
Add const correctness to Accessor and Visitors
This release fix some problems with the "constness" of the VoxelGrid
methods.
In particular, it adds the method VoxelGrid<>::createConstAccessor
and add a const version of VoxelGrid<>::forEachCell
Fix const correctness in the API
Version 0.3.0 had some problems when passing around a VoxelGrid as a const reference.
Changes:
- Some emthods as been marked const, as they should be.
- Added a
ConstAccessor
that can be used to read the value of a cell but not to modify them. - Added a const implementation of
VoxelGrid::forEachCell