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

Issue 1678893002: allocator: add use_experimental_allocator_shim build flag (Closed)

Created:
4 years, 10 months ago by Primiano Tucci (use gerrit)
Modified:
4 years, 10 months ago
CC:
chromium-reviews, wfh+watch_chromium.org, Dai Mikurube (NOT FULLTIME), vmpstr+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

allocator: add use_experimental_allocator_shim build flag This CL introduces a new GYP/GN build flag use_experimental_allocator_shim (default: false). After this CL, the only side-effect of that flag is that tcmalloc does not override anymore the libc symbols (malloc, new etc.). This is in preparation of a unified shim layer, which will come separately in upcoming CLs, which will take care of overriding those symbols in Chrome. Design doc: http://bit.ly/allocator-shim BUG=550886 Committed: https://crrev.com/3217078aa86523fb341e0cf2b0c49d55434b534a Cr-Commit-Position: refs/heads/master@{#374449}

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : add comment #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -2 lines) Patch
M base/allocator/BUILD.gn View 1 chunk +5 lines, -1 line 0 comments Download
M base/allocator/allocator.gyp View 1 2 chunks +6 lines, -0 lines 0 comments Download
M build/config/allocator.gni View 1 1 chunk +7 lines, -0 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/libc_override.h View 1 2 1 chunk +11 lines, -1 line 2 comments Download

Messages

Total messages: 22 (10 generated)
Primiano Tucci (use gerrit)
4 years, 10 months ago (2016-02-08 17:37:06 UTC) #3
Will Harris
lgtm for base/allocator and third_party/tcmalloc https://codereview.chromium.org/1678893002/diff/20001/third_party/tcmalloc/chromium/src/libc_override.h File third_party/tcmalloc/chromium/src/libc_override.h (right): https://codereview.chromium.org/1678893002/diff/20001/third_party/tcmalloc/chromium/src/libc_override.h#newcode64 third_party/tcmalloc/chromium/src/libc_override.h:64: static void ReplaceSystemAlloc() {} ...
4 years, 10 months ago (2016-02-08 19:23:55 UTC) #4
Primiano Tucci (use gerrit)
+brettw for build/config/allocator.gni
4 years, 10 months ago (2016-02-08 19:32:35 UTC) #7
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1678893002/diff/20001/third_party/tcmalloc/chromium/src/libc_override.h File third_party/tcmalloc/chromium/src/libc_override.h (right): https://codereview.chromium.org/1678893002/diff/20001/third_party/tcmalloc/chromium/src/libc_override.h#newcode64 third_party/tcmalloc/chromium/src/libc_override.h:64: static void ReplaceSystemAlloc() {} On 2016/02/08 19:23:55, Will Harris ...
4 years, 10 months ago (2016-02-09 11:38:53 UTC) #8
Primiano Tucci (use gerrit)
+thakis for build/config/allocator.gni
4 years, 10 months ago (2016-02-09 13:47:47 UTC) #10
scottmg
build/config/allocator.gni lgtm
4 years, 10 months ago (2016-02-09 19:46:17 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1678893002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1678893002/40001
4 years, 10 months ago (2016-02-09 19:51:18 UTC) #15
Nico
https://codereview.chromium.org/1678893002/diff/40001/third_party/tcmalloc/chromium/src/libc_override.h File third_party/tcmalloc/chromium/src/libc_override.h (right): https://codereview.chromium.org/1678893002/diff/40001/third_party/tcmalloc/chromium/src/libc_override.h#newcode70 third_party/tcmalloc/chromium/src/libc_override.h:70: static void ReplaceSystemAlloc() {} Which files include this? Defining ...
4 years, 10 months ago (2016-02-09 20:14:23 UTC) #16
Nico
(doesn't have to block cq, just wanted to point that out)
4 years, 10 months ago (2016-02-09 20:14:41 UTC) #17
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 10 months ago (2016-02-09 20:22:26 UTC) #19
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/3217078aa86523fb341e0cf2b0c49d55434b534a Cr-Commit-Position: refs/heads/master@{#374449}
4 years, 10 months ago (2016-02-09 20:23:20 UTC) #21
Primiano Tucci (use gerrit)
4 years, 10 months ago (2016-02-09 20:34:23 UTC) #22
Message was sent while issue was closed.
https://codereview.chromium.org/1678893002/diff/40001/third_party/tcmalloc/ch...
File third_party/tcmalloc/chromium/src/libc_override.h (right):

https://codereview.chromium.org/1678893002/diff/40001/third_party/tcmalloc/ch...
third_party/tcmalloc/chromium/src/libc_override.h:70: static void
ReplaceSystemAlloc() {}
On 2016/02/09 20:14:23, Nico wrote:
> Which files include this? Defining static functions inline without marking
them
> inline generally isn't a good idea (yes, this file does this already) --
you'll
> end up with one copy of the function in every TU including the header. 

So I think that the deal is that this header is a special snowflake and is not
really a header. This is meant to be included only once by tcmalloc.cc.
I think the only reason why this is a .h is because if you name it .cc and add
to the build files, it will be treated as a TU and built independently, which
you do NOT want here either, because this file requires to see the *definitions*
of the tc_* symbols from tcmalloc.cc .
In turn, the reason why this file needs to see the definitions is because of the
attribute(alias) black magic used by the includes below (see
override_gcc_and_weak as an example). attribute(alias) can be used only when the
definition is seen in the same TU.

In other words, this is really a part of tcmalloc.cc,
think to this as a C# .partial.cs file
My guess is that the original authors did split out this header for code
readability convenience (for some definition of "convenience" given the black
magic all around here)

Powered by Google App Engine
This is Rietveld 408576698