Closed Bug 940218 Opened 11 years ago Closed 11 years ago

Build memory/jemalloc and friends in unified mode

Categories

(Core :: Memory Allocator, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: cpeterson, Assigned: iacobcatalin)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file, 1 obsolete file)

Attached patch unify-jemalloc.patch (obsolete) — Splinter Review
Green Try build:
https://tbpl.mozilla.org/?tree=Try&rev=774abfd2bb55
Attachment #8334357 - Flags: review?(mh+mozilla)
Attachment #8334357 - Flags: review?(mh+mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/c3d41ab0a2df
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Depends on: 941616
Backed out for causing bug 941616: https://hg.mozilla.org/integration/mozilla-inbound/rev/f7e67f388134
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
The initial patch changed:
memory/build/moz.build
memory/jemalloc/moz.build
memory/mozalloc/moz.build

https://bugzilla.mozilla.org/show_bug.cgi?id=941616#c5 decided that memory/build/ shouldn't be built in unified mode

The memory/jemalloc/moz.build part gives the linking errors in https://bugzilla.mozilla.org/show_bug.cgi?id=941616#c8 (at least on Windows, when building with --enable-dmd)

At least some of the linking errors happen because each .c file defines a JEMALLOC_<SMTH>_C_ macro in the beginning and those macros change what various includes generate.

For example tcache.c defines JEMALLOC_TCACHE_C_ which decides whether tcache.h generates tcache_tsd_boot via the malloc_tsd_funcs macro:

 #if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_TCACHE_C_))
 /* Map of thread-specific caches. */
 malloc_tsd_externs(tcache, tcache_t *)
 malloc_tsd_funcs(JEMALLOC_INLINE, tcache, tcache_t *, NULL,
     tcache_thread_cleanup)

When we build in unified mode some other file pulls in tcache.h before JEMALLOC_TCACHE_C_ gets defined so no malloc_tsd_funcs is generated.

Given that every jemalloc .c file starts with such a macro which could change arbitrary things it's safer to just not build any of it in unified mode.

We are therefore left with only memory/mozalloc/moz.build which this patch proposes.
Attachment #8334357 - Attachment is obsolete: true
Attachment #8337681 - Flags: review?(ehsan)
Comment on attachment 8337681 [details] [diff] [review]
Minimal patch that works on Windows with --enable-dmd

Review of attachment 8337681 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, thanks!
Attachment #8337681 - Flags: review?(ehsan) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/7a9035c95322
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: