You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regarding using O1Heap with NuttX, I tried allocating a memory arena for use with O1Heap on a dynamically allocated C++ wrapper class (with new) on a PX4 fmuv3 build.
The compiler then throws an error upon instantiating the class about alignment. (Note that this should just be a warning but it seems that the PX4 build demands that all warnings be turned into errors.
error:
error: ‘new’ of type ‘UAVCAN’ with extended alignment 16 [-Waligned-new=]
Setting the alignment to 8 suppresses the warning, but as per O1Heap specifications, the heap must be aligned at the value specified on the O1HEAP_ALIGNMENT definition.
It's not an issue. The compiler is merely telling you that O1HEAP_ALIGNMENT > alignof(std::max_align_t), where O1HEAP_ALIGNMENT = 16 and alignof(std::max_align_t) = 8, which is natural for many 32-bit platforms. You should relax the alignment requirement on your type to avoid this diagnostic; at any rate, it is not related to O1Heap in any way.
Stock NuttX seems to be using a standard O(n) best-fit list-traversal allocator. It should be trivial to replace and benchmark.
The text was updated successfully, but these errors were encountered: