Build mozmemory_wrap as C++

RESOLVED FIXED in Firefox 57

Status

()

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

unspecified
mozilla57
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(4 attachments)

No description provided.
Comment on attachment 8908458 [details]
Bug 1400096 - Remove mozmem_malloc_impl wrapping for operator methods exposed in mozmemory_wrap.c.

https://reviewboard.mozilla.org/r/180112/#review185272
Attachment #8908458 - Flags: review?(n.nethercote) → review+
Comment on attachment 8908459 [details]
Bug 1400096 - Annotate mozmemory_wrap.c windows functions as MOZ_MEMORY_API.

https://reviewboard.mozilla.org/r/180114/#review185274
Attachment #8908459 - Flags: review?(n.nethercote) → review+
Comment on attachment 8908460 [details]
Bug 1400096 - Build mozmemory_wrap as C++.

https://reviewboard.mozilla.org/r/180116/#review185276

::: commit-message-52c6c:3
(Diff revision 1)
> +Bug 1400096 - Build mozmemory_wrap as C++. r?njn
> +
> +And since the build system doesn't handle transitions to foo.c to

"from foo.c"
Attachment #8908460 - Flags: review?(n.nethercote) → review+
Comment on attachment 8908461 [details]
Bug 1400096 - Don't define the operator new/delete functions as mangled in mozmem_wrap.cpp.

https://reviewboard.mozilla.org/r/180118/#review185278

::: memory/build/mozmemory_wrap.cpp:56
(Diff revision 1)
>  {
>    return malloc_impl(size);
>  }
> -/* operator delete(void*, std::nothrow_t const&) */
> -MOZ_MEMORY_API void
> -_ZdlPvRKSt9nothrow_t(void* ptr)
> +
> +MFBT_API void
> +operator delete(void* ptr, std::nothrow_t const&)

The nothrow_t argument disappears and just effectively becomes part of the function name? Interesting.
Attachment #8908461 - Flags: review?(n.nethercote) → review+
(In reply to Nicholas Nethercote [:njn] from comment #8)
> Comment on attachment 8908461 [details]
> Bug 1400096 - Don't define the operator new/delete functions as mangled in
> mozmem_wrap.cpp.
> 
> https://reviewboard.mozilla.org/r/180118/#review185278
> 
> ::: memory/build/mozmemory_wrap.cpp:56
> (Diff revision 1)
> >  {
> >    return malloc_impl(size);
> >  }
> > -/* operator delete(void*, std::nothrow_t const&) */
> > -MOZ_MEMORY_API void
> > -_ZdlPvRKSt9nothrow_t(void* ptr)
> > +
> > +MFBT_API void
> > +operator delete(void* ptr, std::nothrow_t const&)
> 
> The nothrow_t argument disappears and just effectively becomes part of the
> function name? Interesting.

Strictly speaking, it should have been there already, but it's not passed down, the C function signature doesn't change without it, and the file was a C source anyways, so it was not really possible to put it there.
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/6cf651d919d1
Remove mozmem_malloc_impl wrapping for operator methods exposed in mozmemory_wrap.c. r=njn
https://hg.mozilla.org/integration/autoland/rev/092857175e36
Annotate mozmemory_wrap.c windows functions as MOZ_MEMORY_API. r=njn
https://hg.mozilla.org/integration/autoland/rev/09aa9fae6280
Build mozmemory_wrap as C++. r=njn
https://hg.mozilla.org/integration/autoland/rev/738de4c495b9
Don't define the operator new/delete functions as mangled in mozmem_wrap.cpp. r=njn
Blocks: 1052573
Blocks: 1402174
You need to log in before you can comment on or make changes to this bug.