-
Notifications
You must be signed in to change notification settings - Fork 11
Revamp configuration implementation mechanism. #127
Conversation
a7fdd07 to
8aae33a
Compare
|
Rebased this against the latest |
davidbtucker
left a comment
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.
LGTM
src/Makefile
Outdated
| UNAME_S=$(shell uname -s) | ||
| ifeq ($(UNAME_S),Darwin) | ||
| CPPFLAGS+= -I/usr/local/include -I/usr/local/opt/openssl/include | ||
| CPPFLAGS+= -UNOOPT -DNOOPT='[[clang::optnone]]' -I/usr/local/include -I/usr/local/opt/openssl/include |
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.
Add a comment explaining why we need these options.
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.
No longer relevant, so removed.
src/configuration.h
Outdated
|
|
||
| // Shared configuration. | ||
| const std::string& ProjectId() const { | ||
| NOOPT const std::string& ProjectId() const { |
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.
Also comment on the NOOPTs in this file.
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.
Uh, apologies for jumping in here, but [[clang:optnone]] is not guaranteed to be honoured even by clang. If you want to force the function to never be inlined, use a different attribute. In this case, __attribute__((noinline)) is supported by both clang and gcc.
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.
There's definitely something fishy on MacOS with respect to optimizing those functions. It used to crash for me with __attribute__((noinline)), but not with [[clang::optnone]], but no longer seems to. I'll just remove it for now, and we can investigate if the crashes reoccur.
igorpeshansky
left a comment
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.
Thanks. PTAL.
src/configuration.h
Outdated
|
|
||
| // Shared configuration. | ||
| const std::string& ProjectId() const { | ||
| NOOPT const std::string& ProjectId() const { |
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.
There's definitely something fishy on MacOS with respect to optimizing those functions. It used to crash for me with __attribute__((noinline)), but not with [[clang::optnone]], but no longer seems to. I'll just remove it for now, and we can investigate if the crashes reoccur.
src/Makefile
Outdated
| UNAME_S=$(shell uname -s) | ||
| ifeq ($(UNAME_S),Darwin) | ||
| CPPFLAGS+= -I/usr/local/include -I/usr/local/opt/openssl/include | ||
| CPPFLAGS+= -UNOOPT -DNOOPT='[[clang::optnone]]' -I/usr/local/include -I/usr/local/opt/openssl/include |
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.
No longer relevant, so removed.
ff02bae to
ec13632
Compare
|
Rebased off |
bmoyles0117
left a comment
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.
LGTM
This will probably not get merged in its current state, but wanted to start a discussion on a better configuration mechanism implementation.