Skip to content
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

Partial memory leak fix #325

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/ServiceQueueTrajPoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ void Ros_ServiceQueueTrajPoint_Initialize()

//--------------
g_messages_QueueTrajPoint.response = motoros2_interfaces__srv__QueueTrajPoint_Response__create();
rosidl_runtime_c__String__init(&g_messages_QueueTrajPoint.response->message);

//--------------
MOTOROS2_MEM_TRACE_REPORT(svc_queue_point_init);
Expand Down
5 changes: 3 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void RosInitTask()
//==================================
FOREVER
{
MOTOROS2_MEM_TRACE_START(full_connection_cycle);
Ros_Controller_StatusInit();

Ros_Allocation_Initialize(&g_motoros2_Allocator);
Expand Down Expand Up @@ -143,8 +144,7 @@ void RosInitTask()
if (tid == ERROR)
mpSetAlarm(ALARM_TASK_CREATE_FAIL, APPLICATION_NAME " FAILED TO CREATE TASK", SUBCODE_EXECUTOR);

Ros_Debug_BroadcastMsg("Initialization complete. Memory available: (%d) bytes. Memory in use: (%d) bytes",
mpNumBytesFree(), MP_MEM_PART_SIZE - mpNumBytesFree());
Ros_Debug_BroadcastMsg("Initialization complete.");
Comment on lines -146 to +147
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we not move this to a place where initialisation was really complete?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, there isn't anywhere to put it where it will give a deterministic value. We will need to add some semaphores to indicate init-complete on each task and wait for those before dropping into the main loop.


//==================================
ULONG tickBefore = 0;
Expand Down Expand Up @@ -224,6 +224,7 @@ void RosInitTask()
Ros_Sleep(2500);

Ros_Debug_BroadcastMsg("Shutdown complete. Available memory: (%d) bytes", mpNumBytesFree());
MOTOROS2_MEM_TRACE_REPORT(full_connection_cycle);
}
}

Expand Down
Loading