Skip to content
Discussion options

You must be logged in to vote

@ElliotHYLee In linux you have usually a stack size of around 8mb. If you add the C/C++ static keyword the variable is stored in the data segment and not the stack of the program. If you use the iox::vector and construct it like this:

new (&sample.payload_mut()) ComplexDataType {}; 

You perform a placement new directly inside the shared memory, which is not the stack memory, and therefore it works.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ElliotHYLee
Comment options

Answer selected by ElliotHYLee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants