Bug 136993

Summary: bmalloc: Allocation should be more precise
Product: WebKit Reporter: Geoffrey Garen <ggaren>
Component: New BugsAssignee: Geoffrey Garen <ggaren>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, benjamin, cmarcelo, commit-queue, kling, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ggaren: review-
Patch
none
Patch
none
Patch
none
Patch
none
Patch barraclough: review+

Description Geoffrey Garen 2014-09-21 22:09:24 PDT
bmalloc: Allocation should be more precise
Comment 1 Geoffrey Garen 2014-09-21 23:01:30 PDT
Created attachment 238450 [details]
Patch
Comment 2 Geoffrey Garen 2014-09-21 23:02:49 PDT
Created attachment 238451 [details]
Patch
Comment 3 WebKit Commit Bot 2014-09-21 23:03:52 PDT
Attachment 238451 [details] did not pass style-queue:


ERROR: Source/bmalloc/bmalloc/Heap.cpp:237:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/bmalloc/bmalloc/Heap.cpp:262:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 2 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Geoffrey Garen 2014-09-22 00:29:26 PDT
Created attachment 238455 [details]
Patch
Comment 5 Geoffrey Garen 2014-09-22 00:30:19 PDT
Created attachment 238456 [details]
Patch
Comment 6 WebKit Commit Bot 2014-09-22 00:31:30 PDT
Attachment 238456 [details] did not pass style-queue:


ERROR: Source/bmalloc/bmalloc/Heap.cpp:237:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/bmalloc/bmalloc/Heap.cpp:262:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 2 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Geoffrey Garen 2014-09-22 00:43:34 PDT
Created attachment 238457 [details]
Patch
Comment 8 WebKit Commit Bot 2014-09-22 00:46:33 PDT
Attachment 238457 [details] did not pass style-queue:


ERROR: Source/bmalloc/bmalloc/Heap.cpp:237:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/bmalloc/bmalloc/Heap.cpp:262:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 2 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Geoffrey Garen 2014-09-22 18:37:57 PDT
Created attachment 238511 [details]
Patch
Comment 10 WebKit Commit Bot 2014-09-22 18:39:08 PDT
Attachment 238511 [details] did not pass style-queue:


ERROR: Source/bmalloc/bmalloc/Heap.cpp:237:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/bmalloc/bmalloc/Heap.cpp:262:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 2 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Gavin Barraclough 2014-09-23 09:26:47 PDT
Comment on attachment 238457 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=238457&action=review

r+ with discussed scavenge changes.

> Source/bmalloc/ChangeLog:74
> +        (bmalloc::Heap::allocateMediumLineSlowCase): Deleted. Foled into the

Folded?

> Source/bmalloc/bmalloc/Heap.cpp:190
> +void Heap::refillMediumBumpRangeCache(std::lock_guard<StaticMutex>& lock, size_t sizeClass, MediumBumpRangeCache& rangeCache)

Much duplication! so copy!

> Source/bmalloc/bmalloc/Heap.cpp:201
> +    for (size_t lineNumber = 0; lineNumber < end; ++lineNumber) {

Could be worth a comment on these two loops – outer loop finds new disjoint ranges, inner loop coalesces additional lines into a range.

> Source/bmalloc/bmalloc/Heap.cpp:211
> +        while (++lineNumber < end) {

Could be worth a comment on these two loops – outer loop finds new disjoint ranges, inner loop coalesces additional lines into a range.

> Source/bmalloc/bmalloc/Heap.cpp:250
> +MediumPage* Heap::allocateMediumPage(std::lock_guard<StaticMutex>& lock, size_t sizeClass)

Much duplication! so copy!

> Source/bmalloc/bmalloc/Heap.cpp:297
> +void Heap::deallocateMediumLine(std::lock_guard<StaticMutex>& lock, MediumLine* line)

Much duplication! so copy!
Comment 12 Geoffrey Garen 2014-09-23 11:24:10 PDT
Committed r173881: <http://trac.webkit.org/changeset/173881>