Skip to content

Make Ray code C++ compatible#321

Merged
atumanov merged 4 commits intoray-project:masterfrom
pcmoritz:cpp
Mar 1, 2017
Merged

Make Ray code C++ compatible#321
atumanov merged 4 commits intoray-project:masterfrom
pcmoritz:cpp

Conversation

@pcmoritz
Copy link
Copy Markdown
Contributor

No description provided.

@pcmoritz pcmoritz changed the title Make Ray code C++ compatible [WIP] Make Ray code C++ compatible Feb 26, 2017
@pcmoritz pcmoritz force-pushed the cpp branch 2 times, most recently from c43d756 to 90c938b Compare February 28, 2017 19:28
@AmplabJenkins
Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/134/
Test FAILed.

@AmplabJenkins
Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/139/
Test FAILed.

@AmplabJenkins
Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/142/
Test FAILed.

@AmplabJenkins
Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/145/
Test FAILed.

@AmplabJenkins
Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/146/
Test FAILed.

@AmplabJenkins
Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/147/
Test FAILed.

@robertnishihara
Copy link
Copy Markdown
Collaborator

Some compiler warnings

/Users/rkn/Workspace/ray/src/common/test/io_tests.cc:18:23: warning: ISO C++11 does not allow
      conversion from string literal to 'char *' [-Wwritable-strings]
  char *test_string = "hello world";
                      ^
/Users/rkn/Workspace/ray/src/common/test/io_tests.cc:19:22: warning: ISO C++11 does not allow
      conversion from string literal to 'char *' [-Wwritable-strings]
  char *test_bytes = "another string";
                     ^
/Users/rkn/Workspace/ray/src/common/test/io_tests.cc:63:22: warning: ISO C++11 does not allow
      conversion from string literal to 'char *' [-Wwritable-strings]
  char *test_bytes = "another string";
                     ^
3 warnings generated.

@AmplabJenkins
Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/148/
Test FAILed.

@AmplabJenkins
Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/149/
Test FAILed.

Comment thread src/common/state/object_table.cc Outdated
void *user_context) {
CHECK(db_handle != NULL);
ObjectTableSubscribeData *sub_data = malloc(sizeof(ObjectTableSubscribeData));
ObjectTableSubscribeData *sub_data = (ObjectTableSubscribeData *) malloc(sizeof(ObjectTableSubscribeData));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would put the entire right hand side on the second line .

Comment thread src/common/state/object_table.cc Outdated
object_info_done_callback done_callback,
void *user_context) {
ObjectInfoSubscribeData *sub_data = malloc(sizeof(ObjectInfoSubscribeData));
ObjectInfoSubscribeData *sub_data = (ObjectInfoSubscribeData *) malloc(sizeof(ObjectInfoSubscribeData));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same here, might be easier to have the cast and the malloc on the same (second) line.

Comment thread src/common/state/redis.cc
/* Including hiredis here is necessary on Windows for typedefs used in ae.h. */
#include "hiredis/hiredis.h"
#include "hiredis/adapters/ae.h"
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we still need the extern C here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, we do not convert hiredis to C++


int wait_timeout_handler(event_loop *loop, timer_id id, void *context) {
wait_request *wait_req = context;
wait_request *wait_req = (wait_request *) context;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems we're still far from being consistent with the new naming convention, but this sounds like a separate PR to me.

ObjectInfo notification = {.obj_id = object_id, .is_deletion = true};
ObjectInfo notification;
notification.obj_id = object_id;
notification.is_deletion = true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

c++ struct init : ObjectInfo notification = {object_id, true};
but ok as is as well.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One problem with that kind of initialization (which I think I've run into in the past), is that if you change the struct definition it may still compile, but the values might correspond to different fields in the struct now.

local_buf.object_id = oid;
local_buf.data_size = data_size;
local_buf.metadata_size = metadata_size;
local_buf.data = (uint8_t *) malloc(data_size);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

might be best to use cpp struct initialization style here (with so many fields).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks like there may be some uninitialized fields here. This could be the cause of the Travis valgrind failure.

@AmplabJenkins
Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/150/
Test FAILed.

@pcmoritz pcmoritz changed the title [WIP] Make Ray code C++ compatible Make Ray code C++ compatible Mar 1, 2017
@AmplabJenkins
Copy link
Copy Markdown

Merged build finished. Test FAILed.

@AmplabJenkins
Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/152/
Test FAILed.

@atumanov atumanov merged commit 793a102 into ray-project:master Mar 1, 2017
@atumanov atumanov deleted the cpp branch March 1, 2017 09:17
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.

4 participants