Closed
Bug 727202
Opened 13 years ago
Closed 13 years ago
GeckoAppShell.allocateDirectBuffer and freeDirectBuffer don't use jemalloc to allocate/free buffers
Categories
(Core :: mozglue, defect)
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: blassey, Assigned: glandium)
Details
Attachments
(1 file)
1.09 KB,
patch
|
blassey
:
review+
|
Details | Diff | Splinter Review |
I noticed this issue when working on bug 726930 because my code malloc'd the buffer directly then called GeckoAppShell.freeDirectBuffer() to free it and that crashed because of the mismatched allocator.
Updated•13 years ago
|
Assignee: nobody → jdhaliwal
Assignee | ||
Updated•13 years ago
|
Assignee: jdhaliwal → nobody
Component: General → mozglue
Product: Fennec Native → Core
QA Contact: general → mozglue
Summary: GeckoAppShell.allocateDirectBuffer doesn't use jemalloc to allocate its buffer → mozglue internally doesn't use jemalloc
Assignee | ||
Updated•13 years ago
|
OS: Mac OS X → Android
Hardware: x86 → ARM
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → mh+mozilla
Assignee | ||
Comment 1•13 years ago
|
||
Sadly, generalization can't be done in mozglue, because some things that we free() are allocated by the android libc. So in the end, this will need to be a localized fix.
Summary: mozglue internally doesn't use jemalloc → GeckoAppShell.allocateDirectBuffer and freeDirectBuffer don't use jemalloc to allocate/free buffers
Assignee | ||
Comment 2•13 years ago
|
||
Attachment #597412 -
Flags: review?(blassey.bugs)
Reporter | ||
Updated•13 years ago
|
Attachment #597412 -
Flags: review?(blassey.bugs) → review+
Reporter | ||
Comment 3•13 years ago
|
||
Comment on attachment 597412 [details] [diff] [review]
Wrap malloc and free to use jemalloc in GeckoAppShell.{allocate,free}DirectBuffer
Mike, I think I'd slightly prefer using the --wrap flags so nothing else allocates using the standard allocators. Is there any reason not to do that?
Assignee | ||
Comment 4•13 years ago
|
||
One reason is that --wrap only works when the wrapped function is in an external library. mozglue/android and jemalloc are in the same library.
The other reason is in comment 1.
Reporter | ||
Comment 5•13 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #4)
> One reason is that --wrap only works when the wrapped function is in an
> external library. mozglue/android and jemalloc are in the same library.
> The other reason is in comment 1.
Right, I failed to read comment 1 before commenting. So, ignore comment 3.
Assignee | ||
Comment 6•13 years ago
|
||
Not that eventually, mozalloc will be folded in mozglue, at which point using operator new and delete in mozglue will use jemalloc. When that happens, we can remove this hack and replace malloc and free with new and delete.
Assignee | ||
Comment 7•13 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #6)
> Not that eventually,(...)
Note, not not
Assignee | ||
Comment 8•13 years ago
|
||
Comment 9•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in
before you can comment on or make changes to this bug.
Description
•