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
Easy enough on the surface (add a member + length parameters and calculate the allocation size with a few offsetof and sizeof calls) and so far I came up with this implementation:
I'd like to extend libcsptr (specifically, the
shared_ptr
/unique_ptr
macros) to handle C99 structs with flexible array members.I. e.
Easy enough on the surface (add a member + length parameters and calculate the allocation size with a few offsetof and sizeof calls) and so far I came up with this implementation:
However, including a struct with a flexible array member as a non-last member of another struct is a (now-deprecated) gcc extension.
Any ideas on how to do this properly and preserve the ergonomics of accepting an optional destructor + metadata at the end of the
smart_flex()
call?The text was updated successfully, but these errors were encountered: