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

[RFC] reduce heap memory allocations to zero #158

Merged
merged 1 commit into from
Jul 6, 2017

Conversation

sergiud
Copy link
Collaborator

@sergiud sergiud commented Jan 18, 2017

In case there's thread-local storage (TLS) support, logging doesn't need to allocate memory for every message making it more memory efficient.

@googlebot
Copy link
Collaborator

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

@sergiud sergiud changed the title [RFC] reduce heapy memory allocations to zero [RFC] reduce heap memory allocations to zero Jan 18, 2017
@sergiud sergiud force-pushed the zero-allocation branch 2 times, most recently from 05e83e5 to 73203be Compare January 18, 2017 09:32
@googlebot
Copy link
Collaborator

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@hansres
Copy link
Contributor

hansres commented Jan 18, 2017

I confirm being okay with my commits being contributed to this project.

@sergiud
Copy link
Collaborator Author

sergiud commented Feb 22, 2017

@ukai Could you please take a look at this PR?

Copy link
Collaborator

@shinh shinh left a comment

Choose a reason for hiding this comment

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

I put a comment but otherwise LGTM. I think this is a great idea. It'd be also great if ./configure supports this, too, but I don't think we need it in this PR. Thanks!

src/logging.cc Outdated
thread_data_available = false;
data_ = new (&thread_msg_data) LogMessageData();
} else {
allocated_ = new LogMessageData();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd add a test case for this code path. Just

LOG(INFO) << LOG(INFO) << "nested LOG";

should be fine.

@googlebot
Copy link
Collaborator

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@googlebot
Copy link
Collaborator

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@sergiud
Copy link
Collaborator Author

sergiud commented Jul 5, 2017

@shinh Done. Please review.

@shinh shinh removed the cla: no label Jul 6, 2017
@shinh shinh merged commit a835da8 into google:master Jul 6, 2017
durswd pushed a commit to durswd/glog that referenced this pull request Sep 2, 2019
[RFC] reduce heap memory allocations to zero
@sergiud sergiud deleted the zero-allocation branch April 12, 2021 12:45
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