-
Notifications
You must be signed in to change notification settings - Fork 66
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
Fix ASan report about alloc/dealloc mismatch when compiled with C++23 #633
Changes from 6 commits
f39b166
50f3e0d
4e589dc
361cab7
8f98191
bec890f
0948921
1c8ab9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,10 @@ namespace Aws | |
return static_cast<RawPointer>(aws_mem_acquire(m_allocator, n * sizeof(T))); | ||
} | ||
|
||
#if _LIBCPP_STD_VER > 20 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we really need #if here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. std::allocation_result was added in _LIBCPP_STD_VER > 20 |
||
std::allocation_result<T *> allocate_at_least(size_type n) { return {allocate(n), n}; } | ||
#endif | ||
|
||
void deallocate(RawPointer p, size_type) | ||
{ | ||
AWS_ASSERT(m_allocator); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
std::allocator<T>
doesn't have any virtual functions ... does that mean nothing should inherit from it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline, we will backlog this for now. We should probably be using https://docs.ros.org/en/foxy/Tutorials/Advanced/Allocator-Template-Tutorial.html