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

Issue 2028183002: tcmalloc_unittest: Use malloc and free directly, instead of tc_malloc and tc_free. (Closed)

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

Description

tcmalloc_unittest: Use malloc and free directly, instead of tc_malloc and tc_free. tcmalloc defines malloc and free as wrappers (or aliases) for tc_malloc and tc_free, so we can test tcmalloc by using malloc and free directly instead of tc_malloc and tc_free. This fixes the test in component builds, where tc_malloc and tc_free are defined in a separate DSO with hidden visibility (due to https://codereview.chromium.org/2019183002/), and so will not be visible to tests. Some compilers (e.g. clang) will specifically recognize and optimize away calls to malloc and free, which would break these tests, as they are testing specific behavior of the allocator. Address this by marking the wrappers for malloc and free as NOINLINE. BUG= TBR=primiano@chromium.org Committed: https://crrev.com/453035e20f3baca9b2c143407a814cd9581775ca Cr-Commit-Position: refs/heads/master@{#397204}

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -9 lines) Patch
M base/allocator/tcmalloc_unittest.cc View 1 chunk +8 lines, -9 lines 1 comment Download

Messages

Total messages: 7 (2 generated)
pcc1
4 years, 6 months ago (2016-06-01 18:12:23 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2028183002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2028183002/1
4 years, 6 months ago (2016-06-01 18:14:27 UTC) #3
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 6 months ago (2016-06-01 19:25:33 UTC) #4
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/453035e20f3baca9b2c143407a814cd9581775ca Cr-Commit-Position: refs/heads/master@{#397204}
4 years, 6 months ago (2016-06-01 19:27:50 UTC) #6
Primiano Tucci (use gerrit)
4 years, 6 months ago (2016-06-01 20:29:06 UTC) #7
Message was sent while issue was closed.
LGTM

https://codereview.chromium.org/2028183002/diff/1/base/allocator/tcmalloc_uni...
File base/allocator/tcmalloc_unittest.cc (right):

https://codereview.chromium.org/2028183002/diff/1/base/allocator/tcmalloc_uni...
base/allocator/tcmalloc_unittest.cc:23: NOINLINE void*
TCMallocDoMallocForTest(size_t size) {
Oh, I would have never thought to this. right.

Powered by Google App Engine
This is Rietveld 408576698