Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(866)

Issue 2793793002: Fix -Wshift-negative-value transgression in tcmalloc. (Closed)

Created:
3 years, 8 months ago by Nico
Modified:
3 years, 8 months ago
CC:
chromium-reviews, wfh+watch_chromium.org, Dai Mikurube (NOT FULLTIME), vmpstr+watch_chromium.org, Lei Zhang
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix -Wshift-negative-value transgression in tcmalloc. BUG=706476 Review-Url: https://codereview.chromium.org/2793793002 Cr-Commit-Position: refs/heads/master@{#461344} Committed: https://chromium.googlesource.com/chromium/src/+/726c89662647e7699554827c170d88f7f0543606

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -9 lines) Patch
M base/allocator/BUILD.gn View 1 chunk +2 lines, -8 lines 0 comments Download
M third_party/tcmalloc/README.chromium View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/base/basictypes.h View 1 chunk +1 line, -1 line 3 comments Download

Messages

Total messages: 18 (12 generated)
Nico
3 years, 8 months ago (2017-04-02 00:49:44 UTC) #4
Primiano Tucci (use gerrit)
thanks! lgtm https://codereview.chromium.org/2793793002/diff/1/third_party/tcmalloc/chromium/src/base/basictypes.h File third_party/tcmalloc/chromium/src/base/basictypes.h (right): https://codereview.chromium.org/2793793002/diff/1/third_party/tcmalloc/chromium/src/base/basictypes.h#newcode85 third_party/tcmalloc/chromium/src/base/basictypes.h:85: const int64 kint64min = (-kint64max - 1LL); ...
3 years, 8 months ago (2017-04-02 16:49:44 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2793793002/1
3 years, 8 months ago (2017-04-02 16:50:14 UTC) #13
Nico
Thanks! https://codereview.chromium.org/2793793002/diff/1/third_party/tcmalloc/chromium/src/base/basictypes.h File third_party/tcmalloc/chromium/src/base/basictypes.h (right): https://codereview.chromium.org/2793793002/diff/1/third_party/tcmalloc/chromium/src/base/basictypes.h#newcode85 third_party/tcmalloc/chromium/src/base/basictypes.h:85: const int64 kint64min = (-kint64max - 1LL); On ...
3 years, 8 months ago (2017-04-02 18:17:54 UTC) #14
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/726c89662647e7699554827c170d88f7f0543606
3 years, 8 months ago (2017-04-02 18:29:33 UTC) #17
Lei Zhang
3 years, 8 months ago (2017-04-03 20:51:08 UTC) #18
Message was sent while issue was closed.
https://codereview.chromium.org/2793793002/diff/1/third_party/tcmalloc/chromi...
File third_party/tcmalloc/chromium/src/base/basictypes.h (right):

https://codereview.chromium.org/2793793002/diff/1/third_party/tcmalloc/chromi...
third_party/tcmalloc/chromium/src/base/basictypes.h:85: const  int64 kint64min =
 (-kint64max - 1LL);
On 2017/04/02 18:17:54, Nico (afk until Tue Apr 4) wrote:
> On 2017/04/02 16:49:44, Primiano Tucci wrote:
> > took my a while to figure out why this was defined like this (which, after
> some
> > googling, seems to match most #define INT64_MIN out there).
> > It's impressive how these days we have very sophisticated features like
> lambdas
> > with captures, rvalue references, thread-safe statics, but still, integers
are
> > so frighteningly easy to get wrong.
> > 
> > Instead, I have to admit I still can't figure out the kint64max above ? Why
> > isn't that just 0x7fff(enough f's)LL ? (and, to be clear, I am not implying
we
> > should change it, but just curious at this point)
> 
> 0xffff is an int literal. 0xffffLL should work, but that wasn't standardized
> until I think c++11, and tcmalloc predates that. I agree that would be better,
> but the current way fits the file better. (There's a lot of stuff in here we
> could delete with c++11.)

Do we want to file a bug to refresh tcmalloc with C++11?

Powered by Google App Engine
This is Rietveld 408576698