Skip to content
This repository was archived by the owner on Aug 19, 2019. It is now read-only.

Conversation

@igorpeshansky
Copy link
Contributor

This will probably not get merged in its current state, but wanted to start a discussion on a better configuration mechanism implementation.

@igorpeshansky
Copy link
Contributor Author

Rebased this against the latest master. This is ready to be reviewed.

@igorpeshansky igorpeshansky requested review from davidbtucker and removed request for ACEmilG May 23, 2018 19:55
Copy link
Contributor

@davidbtucker davidbtucker left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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.


// Shared configuration.
const std::string& ProjectId() const {
NOOPT const std::string& ProjectId() const {
Copy link
Contributor

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.

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

@igorpeshansky igorpeshansky left a comment

Choose a reason for hiding this comment

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

Thanks. PTAL.


// Shared configuration.
const std::string& ProjectId() const {
NOOPT const std::string& ProjectId() const {
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

@igorpeshansky
Copy link
Contributor Author

Rebased off master. PTAL.

Copy link
Contributor

@bmoyles0117 bmoyles0117 left a comment

Choose a reason for hiding this comment

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

LGTM

@igorpeshansky igorpeshansky changed the title RFC: Revamp configuration implementation mechanism. Revamp configuration implementation mechanism. Sep 11, 2018
@igorpeshansky igorpeshansky merged commit d481466 into master Sep 11, 2018
@igorpeshansky igorpeshansky deleted the igorp-config-revamp branch September 11, 2018 23:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants