Closed Bug 1420355 Opened 7 years ago Closed 7 years ago

Allow to statically link replace-malloc libraries

Categories

(Core :: Memory Allocator, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(7 files)

      No description provided.
Comment on attachment 8932388 [details]
Bug 1420355 - Don't link logalloc against the static runtime on Windows.

https://reviewboard.mozilla.org/r/203416/#review209168
Attachment #8932388 - Flags: review?(n.nethercote) → review+
Comment on attachment 8932389 [details]
Bug 1420355 - Don't declare replace_* functions in replace_malloc.h.

https://reviewboard.mozilla.org/r/203418/#review209170
Attachment #8932389 - Flags: review?(n.nethercote) → review+
Comment on attachment 8932390 [details]
Bug 1420355 - Remove fallbacks when DMD is initializing.

https://reviewboard.mozilla.org/r/203420/#review209172

Nice.
Attachment #8932390 - Flags: review?(n.nethercote) → review+
Comment on attachment 8932391 [details]
Bug 1420355 - Don't initialize logalloc if MALLOC_LOG is not given.

https://reviewboard.mozilla.org/r/203422/#review209174
Attachment #8932391 - Flags: review?(n.nethercote) → review+
Comment on attachment 8932392 [details]
Bug 1420355 - Don't initialize DMD if the DMD environment variable is not given.

https://reviewboard.mozilla.org/r/203424/#review209176

::: commit-message-c6b2a:4
(Diff revision 1)
> +Bug 1420355 - Don't initialize DMD if the DMD environment variable is not given. r?njn
> +
> +This makes things slightly more inconvenient (having to set two
> +environmnt variables instead of one for the simplest case) until a few

typo: environmnt

::: memory/replace/dmd/DMD.cpp:1565
(Diff revision 1)
> +  }
> +  // Initialize the function table first, because StatusMsg uses
> +  // InfallibleAllocPolicy::malloc_, which uses it.
>    gMallocTable = *aMallocTable;
> +
> +  StatusMsg("$DMD = '%s'\n", e);

It would be nice to have a StatusMsg here, something like "$DMD is undefined; DMD will not run".
Attachment #8932392 - Flags: review?(n.nethercote) → review+
Comment on attachment 8932393 [details]
Bug 1420355 - Allow to statically link replace-malloc libraries.

https://reviewboard.mozilla.org/r/203426/#review209192

::: build/moz.configure/memory.configure:70
(Diff revision 1)
> +
> +
> +@depends(replace_malloc, build_project)
> +def replace_malloc_static(replace_malloc, build_project):
> +    # Default to statically linking replace-malloc libraries that can be
> +    # statically linked, except when building with --enable-project=memory

Nit: '.' at end of sentence.

::: memory/build/mozjemalloc.cpp:4913
(Diff revision 1)
>    gReplaceMallocInitialized = true;
>    if (replace_init) {
>      replace_init(&gReplaceMallocTable, &gReplaceMallocBridge);
>    }
> +#ifdef MOZ_REPLACE_MALLOC_STATIC
> +  if (initialTable == gReplaceMallocTable) {

I wonder if using a method name like Equals() would be better. It's easy to misread this as a pointer equality.
Attachment #8932393 - Flags: review?(n.nethercote) → review+
Comment on attachment 8932394 [details]
Bug 1420355 - Statically link DMD.

https://reviewboard.mozilla.org/r/203428/#review209194

This certainly simplifies lots of stuff.
Attachment #8932394 - Flags: review?(n.nethercote) → review+
(In reply to Nicholas Nethercote [:njn] from comment #12)
> > +  StatusMsg("$DMD = '%s'\n", e);
> 
> It would be nice to have a StatusMsg here, something like "$DMD is
> undefined; DMD will not run".

That would pollute the output of Firefox, since DMD is always there (in debug builds for now, but in opt builds too after bug  1409739).
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/d80b5c4e1dd0
Don't link logalloc against the static runtime on Windows. r=njn
https://hg.mozilla.org/integration/autoland/rev/451cd087922f
Don't declare replace_* functions in replace_malloc.h. r=njn
https://hg.mozilla.org/integration/autoland/rev/3742a4b69ba2
Remove fallbacks when DMD is initializing. r=njn
https://hg.mozilla.org/integration/autoland/rev/e69357ccca9e
Don't initialize logalloc if MALLOC_LOG is not given. r=njn
https://hg.mozilla.org/integration/autoland/rev/0479dda078a2
Don't initialize DMD if the DMD environment variable is not given. r=njn
https://hg.mozilla.org/integration/autoland/rev/fd6702e6e0a0
Allow to statically link replace-malloc libraries. r=njn
https://hg.mozilla.org/integration/autoland/rev/a7ed89e13a4c
Statically link DMD. r=njn
Turns out the last commit was removing things that were used for other things than DMD.
Flags: needinfo?(mh+mozilla)
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/30920e0f5df4
Don't link logalloc against the static runtime on Windows. r=njn
https://hg.mozilla.org/integration/autoland/rev/921a1441fd22
Don't declare replace_* functions in replace_malloc.h. r=njn
https://hg.mozilla.org/integration/autoland/rev/a19bce0cd06c
Remove fallbacks when DMD is initializing. r=njn
https://hg.mozilla.org/integration/autoland/rev/b19b3307075a
Don't initialize logalloc if MALLOC_LOG is not given. r=njn
https://hg.mozilla.org/integration/autoland/rev/f1d96b6ee076
Don't initialize DMD if the DMD environment variable is not given. r=njn
https://hg.mozilla.org/integration/autoland/rev/076e21f3b25e
Allow to statically link replace-malloc libraries. r=njn
https://hg.mozilla.org/integration/autoland/rev/eff8b66ce5c7
Statically link DMD. r=njn
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/c387f1f2e93e
Port bug 1420355 to TB/IB/SM: Statically link DMD. rs=bustage-fix
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: