Skip to content

Conversation

@rarvolt
Copy link
Contributor

@rarvolt rarvolt commented Jan 1, 2019

This fixes #255

@tfoote tfoote added the in review Waiting for review (Kanban column) label Jan 1, 2019
Copy link
Contributor

@tfoote tfoote left a comment

Choose a reason for hiding this comment

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

This also follows a different paradigm where the other APIs return a pointer to an internal string versus returning a pointer to a recently allocated string and expecting the user to free it. This asymmetry in the API is likely to cause coding errors.

To that end I might suggest that the fq_name be precomputed and stored whenever the name and namespace are set, and then a pointer to that is returned by this function instead of the function allocating new memory just to return the string.

* <hr>
* Attribute | Adherence
* ------------------ | -------------
* Allocates Memory | Yes
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be great to be able to use this in applications that require allocation free operations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.
name and namespace are stored in the specific rmw implementation (if I understand correctly) and I hesitated from making changes across many repos. Thats why I decided to store the computed fq_name in the rcl_node_impl_t structure.

@cottsay cottsay requested a review from tfoote January 31, 2019 18:18
Copy link
Contributor

@tfoote tfoote left a comment

Choose a reason for hiding this comment

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

Thanks that looks good now. I've triggered CI

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@tfoote
Copy link
Contributor

tfoote commented Feb 1, 2019

@rarvolt This looks good overall. It failed CI so I rebased it and pushed to a local branch. If you have a moment to rebase this yourself that would be great. As well we've added a DCO that would be great if you could sign off on by signing your commits. We're not yet strictly enforcing the DCO during the transition but it would be great if you'd be willing to try it out and give us any feedback at this stage.

More info on the DCO is here: https://probot.github.io/apps/dco/

@tfoote
Copy link
Contributor

tfoote commented Feb 1, 2019

The rebase passed in #381 If you have a chance to rebase it before tomorrow that would be great. Otherwise I'll merge my rebase.

@tfoote
Copy link
Contributor

tfoote commented Feb 2, 2019

Superceded by #381

@tfoote tfoote closed this Feb 2, 2019
@tfoote tfoote removed the in review Waiting for review (Kanban column) label Feb 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get fully qualified node name

2 participants