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)

defect
Not set
normal

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)

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: nobody → justin.lebar+bug
Does zone_good_size() ever get called? I see it's only relevant for Mac but I couldn't untangle the spaghetti further.
I don't know if it gets called. We don't call it, but the system might.
I smell a premature optimization. Some numbers on how often it's called would be nice.
> 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?
Oh, if it's not original jemalloc code that's different. It'd still be nice to know how often it's called.
It gets called a fair bit. Loading about:home, slashdot, google, gmail, I get 23741 calls.
I thought zone_good_size was part of *our* Mac port, but it appears upstream, so I was probably wrong.
Attached patch Patch v1Splinter Review
Attachment #572000 - Flags: review?(khuey)
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+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
Is this something QA can verify?
Whiteboard: [inbound] → [inbound][qa?]
(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.
Whiteboard: [inbound][qa?] → [inbound][qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: