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

use one copy for continuous area instead of loop copy #312

Merged
merged 3 commits into from
Nov 18, 2020

Conversation

iuhilnehc-ynos
Copy link
Collaborator

Signed-off-by: Chen Lihui lihui.chen@sony.com

Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

lgtm with minor comment.


ret = rcutils_array_list_get(&list, 0, &ret_data);
EXPECT_EQ(RCUTILS_RET_OK, ret) << rcutils_get_error_string().str;
EXPECT_EQ((uint32_t)2, ret_data) << rcutils_get_error_string().str;
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we would want to call the following after this,

  • rcutils_array_list_remove(&list, 0)
  • rcutils_array_list_get_size(&list, &size)

to make sure corner case which is to remove last entry from the array_list.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

reasonable 👍

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

I've got one small thing to fix. Also, can you please run this test under valgrind just to ensure we aren't accessing any data out-of-bounds? Once those two things are done, I'm happy to approve.

test/test_array_list.cpp Show resolved Hide resolved
Chen Lihui and others added 3 commits November 13, 2020 22:54
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
Signed-off-by: Chen Lihui <Lihui.Chen@sony.com>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

Looks good to me now. Thanks for iterating. Will run CI on it next.

@clalancette
Copy link
Contributor

CI:

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

@iuhilnehc-ynos
Copy link
Collaborator Author

Hi, @clalancette
Do you think the test cases that failed in macOS and Windows are caused by this PR? If so, I'll investigate them on these platforms.

@clalancette
Copy link
Contributor

Do you think the test cases that failed in macOS and Windows are caused by this PR? If so, I'll investigate them on these platforms.

No, I don't think so. Those tests have been flaky in the nightlies for a while. This one just fell off of my radar, thanks for the ping. I'm going to go ahead and merge this.

@clalancette clalancette merged commit ee27b75 into ros2:master Nov 18, 2020
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.

3 participants