ServiceInterface changes from #93 do allocate memory at runtime #149

Closed
opened 2020-07-21 15:10:43 +02:00 by gaisser · 0 comments
Owner

The Service Interface stream allocates memory at runtime. It allocates 41 Bytes by returning a copy of a std::string in "getPreamble".

auto preamble = getPreamble(&preambleSize);

The preamble is allocated at construction time as a member of the ServiceInterfaceBuffer so we can return a pointer to it. So, the fix would be to change getPreamble in the ServiceInterfaceBuffer to:

std::string* getPreamble(size_t * preambleSize = nullptr)
The Service Interface stream allocates memory at runtime. It allocates 41 Bytes by returning a copy of a std::string in "getPreamble". ``` C++ auto preamble = getPreamble(&preambleSize); ``` The preamble is allocated at construction time as a member of the ServiceInterfaceBuffer so we can return a pointer to it. So, the fix would be to change getPreamble in the ServiceInterfaceBuffer to: ```C++ std::string* getPreamble(size_t * preambleSize = nullptr) ```
gaisser added the
bug
label 2020-07-21 15:10:43 +02:00
gaisser referenced this issue from a commit 2020-07-21 15:16:31 +02:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: fsfw/fsfw#149
No description provided.