Closed
Bug 699395
Opened 13 years ago
Closed 13 years ago
Modify zone_good_size to call je_malloc_usable_size_in_advance
Categories
(Core :: Memory Allocator, defect)
Core
Memory Allocator
Tracking
()
RESOLVED
FIXED
mozilla10
Tracking | Status | |
---|---|---|
firefox10 | --- | fixed |
People
(Reporter: justin.lebar+bug, Assigned: justin.lebar+bug)
References
Details
(Whiteboard: [inbound][qa-])
Attachments
(1 file)
1.15 KB,
patch
|
n.nethercote
:
review+
|
Details | Diff | Splinter Review |
Currently,
zone_good_size(size) {
p = malloc(size)
ret = malloc_usable_size(p)
free(p)
return ret
}
Instead, it should just call je_malloc_usable_size_in_advance from bug 678977.
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → justin.lebar+bug
Comment 1•13 years ago
|
||
Does zone_good_size() ever get called? I see it's only relevant for Mac but I couldn't untangle the spaghetti further.
Assignee | ||
Comment 2•13 years ago
|
||
I don't know if it gets called. We don't call it, but the system might.
Comment 3•13 years ago
|
||
I smell a premature optimization. Some numbers on how often it's called would be nice.
Assignee | ||
Comment 4•13 years ago
|
||
> Some numbers on how often it's called would be nice.
Sure. But it's a totally brain-dead implementation now (comes from our Mac port, not originally from jemalloc), and we have a smart function which does exactly the same thing... This doesn't count as code cleanup?
Comment 5•13 years ago
|
||
Oh, if it's not original jemalloc code that's different. It'd still be nice to know how often it's called.
Assignee | ||
Comment 6•13 years ago
|
||
It gets called a fair bit. Loading about:home, slashdot, google, gmail, I get 23741 calls.
Assignee | ||
Comment 7•13 years ago
|
||
I thought zone_good_size was part of *our* Mac port, but it appears upstream, so I was probably wrong.
Assignee | ||
Comment 8•13 years ago
|
||
Attachment #572000 -
Flags: review?(khuey)
Comment 9•13 years ago
|
||
Comment on attachment 572000 [details] [diff] [review]
Patch v1
Review of attachment 572000 [details] [diff] [review]:
-----------------------------------------------------------------
Stealing the review! Looks fine.
Attachment #572000 -
Flags: review?(khuey) → review+
Assignee | ||
Comment 10•13 years ago
|
||
status-firefox10:
--- → fixed
Whiteboard: [inbound]
Comment 11•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
Comment 13•13 years ago
|
||
(In reply to Anthony Hughes, Mozilla QA (irc: ashughes) from comment #12)
> Is this something QA can verify?
Probably not, unless you pull out a debugger and step through the code. I wouldn't bother, myself.
You need to log in
before you can comment on or make changes to this bug.
Description
•