-
Notifications
You must be signed in to change notification settings - Fork 163
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
Add an allocator to the external logging initialization. #430
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,13 +25,21 @@ | |
* logging library should use to configure itself. | ||
* If no config file is provided this will be set to an empty string. | ||
* Must be a NULL terminated c string. | ||
* \param[in] allocator The allocator to use for memory allocation. This is | ||
* an rcutils_allocator_t rather than an rcl_allocator_t to ensure that the | ||
* rcl_logging_* packages don't have a circular dependency back to rcl. | ||
* \todo TODO(clalancette) This API is marked RCL_PUBLIC, but is not built or | ||
* exported from librcl. Instead, these headers should be split into a | ||
* separate package which is then depended on by both rcl and the | ||
* rcl_logging_* implementations. The duplicated headers from the | ||
* implementations could then be removed. | ||
* \return RCL_RET_OK if initialized successfully, or | ||
* \return RCL_RET_ERROR if an unspecified error occurs. | ||
*/ | ||
RCL_PUBLIC | ||
RCL_WARN_UNUSED | ||
rcl_ret_t | ||
rcl_logging_external_initialize(const char * config_file); | ||
rcl_logging_external_initialize(const char * config_file, rcutils_allocator_t allocator); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We discussed offline about the fact that this needs to be deduplicated, but @clalancette is just going to make a TODO for now. |
||
|
||
/// Free the resources allocated for the external logging system. | ||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For semantics shouldn't this be an rcl_allocator_t?
That's what's used internallly currently:
rcl/rcl/src/rcl/logging.c
Line 41 in eabe426
Of course it's the same via typedef:
rcl/rcl/include/rcl/allocator.h
Line 25 in 3b9475b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that these packages shouldn't depend on
rcl
, as it creates a circular dependency. Also, all of the functions I'm going to eventually call are inrcutils
, so I think it makes more sense as anrcutils_allocator_t
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 That actually is a good idea. Though they are just a
typedef
to one another right now.