Skip to content

Commit

Permalink
Allocator and free functions for rmw_participant_qos_profile
Browse files Browse the repository at this point in the history
Signed-off-by: Jaison Titus <jaisontj92@gmail.com>
  • Loading branch information
jaisontj committed Sep 27, 2019
1 parent 8a3d0a0 commit fe20b6f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rmw/include/rmw/allocators.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ RMW_PUBLIC
void
rmw_wait_set_free(rmw_wait_set_t * wait_set);

/**
* @return an allocated instance of rmw_participant_qos_profile_t.
*/
RMW_PUBLIC
rmw_participant_qos_profile_t *
rmw_participant_qos_profile_allocate(void);

/**
* Frees the allocated instance.
* @param participant_qos_profile the instance to free.
*/
RMW_PUBLIC
void
rmw_participant_qos_profile_free(rmw_participant_qos_profile_t * participant_qos_profile);

#ifdef __cplusplus
}
#endif
Expand Down
20 changes: 20 additions & 0 deletions rmw/src/allocators.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,23 @@ rmw_wait_set_free(rmw_wait_set_t * wait_set)
// Should have matching overide with rmw_wait_set_allocate
rmw_free(wait_set);
}

/**
* @return an allocated instance of rmw_participant_qos_profile_t.
*/
rmw_participant_qos_profile_t *
rmw_participant_qos_profile_allocate()
{
return (rmw_participant_qos_profile_t *)rmw_allocate(sizeof(rmw_participant_qos_profile_t));
}

/**
* Frees the allocated instance.
* @param participant_qos_profile the instance to free.
*/
void
rmw_participant_qos_profile_free(rmw_participant_qos_profile_t * participant_qos_profile)
{
rmw_free(participant_qos_profile);
}

0 comments on commit fe20b6f

Please sign in to comment.