Open Bug 1137570 Opened 9 years ago Updated 2 years ago

libsoundtouch and webrtc are not using the wrapped operator new

Categories

(Core :: Memory Allocator, defect)

defect

Tracking

()

People

(Reporter: glandium, Unassigned)

References

(Blocks 1 open bug)

Details

Essentially, the problem is that operator new is implicitly defined, so one doesn't need to #include <new> to use it. If none of the wrapped headers is included somehow, we end up not using our own operator new.

In practice, this doesn't matter on Linux, b2g and Mac because everything uses "system" malloc under the hood, and "system" malloc is hooked such as jemalloc is called instead. On Android, we export operator new/delete symbols from mozglue, which take precedence over the system one at dynamic linking time.

On Windows, it /could/ actually end up calling the system operator new, but we're lucky, in that our operator new wrapper ends up in the .objs that use it, and the webrtc and libsoundtouch parts that don't use the wrapper end up using it because the linker prefers operator new from those objs instead of the one from the crt.

That's rather fragile and should be fixed.
Blocks: 1134914
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.