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

Issue 1330593002: Clean up round and align in PartitionAlloc (Closed)

Created:
5 years, 3 months ago by Ruud van Asseldonk
Modified:
5 years ago
CC:
Mads Ager (chromium), blink-reviews, blink-reviews-wtf_chromium.org, haraken, kouhei+heap_chromium.org, Mikhail, oilpan-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@cleanup-partalloc
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Clean up round and align in PartitionAlloc |partitionDirectMapSize| and |partitionRoundUpToSystemPage| were duplicates of eachother, modulo the assertion. The rounding function was abused to align pointers in addition to rounding sizes. With this CL there is one function for size rounding and two functions to align pointers (up and down). Note that the reinterpret cast magic was already there. It relies on the fact that on the platforms we build for, pointers are integers. This CL simply moves the casts into the function to avoid repetition.

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address review issues #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -10 lines) Patch
M Source/wtf/PartitionAlloc.h View 1 1 chunk +6 lines, -1 line 0 comments Download
M Source/wtf/PartitionAlloc.cpp View 1 4 chunks +13 lines, -9 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 5 (3 generated)
Primiano Tucci (use gerrit)
some comments, I think here you just want to fix the names and the castin ...
5 years, 3 months ago (2015-09-03 11:24:54 UTC) #2
Ruud van Asseldonk
5 years, 3 months ago (2015-09-03 13:44:48 UTC) #4
https://codereview.chromium.org/1330593002/diff/1/Source/wtf/PartitionAlloc.cpp
File Source/wtf/PartitionAlloc.cpp (right):

https://codereview.chromium.org/1330593002/diff/1/Source/wtf/PartitionAlloc.c...
Source/wtf/PartitionAlloc.cpp:514: size_t addr = reinterpret_cast<size_t>(ptr);
On 2015/09/03 at 11:24:53, Primiano Tucci wrote:
> these should be uintptr_t, also + const (i.e. const uintptr_t)

Sure, but note that the current code uses size_t.

https://codereview.chromium.org/1330593002/diff/1/Source/wtf/PartitionAlloc.h
File Source/wtf/PartitionAlloc.h (left):

https://codereview.chromium.org/1330593002/diff/1/Source/wtf/PartitionAlloc.h...
Source/wtf/PartitionAlloc.h:729: ALWAYS_INLINE size_t
partitionDirectMapSize(size_t size)
On 2015/09/03 at 11:24:53, Primiano Tucci wrote:
> I think this should stay as it is (as the assert is map-specific)

Done.

Powered by Google App Engine
This is Rietveld 408576698