Remove NS_Alloc/NS_Realloc/NS_Free for real

RESOLVED FIXED in Firefox 58

Status

()

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: njn, Assigned: glandium)

Tracking

Trunk
mozilla58
Points:
---

Firefox Tracking Flags

(firefox58 fixed)

Details

Attachments

(2 attachments)

Bug 1134923 mostly removed them, but left behind a tiny bit of use. glandium says they can be removed now that we don't use the xpcom glue any more.
Actually, they ended up being removed in bug 1306327.

What remains is:
#ifdef XPCOM_GLUE
XPCOM_API(void*) NS_Alloc(size_t aSize);
XPCOM_API(void*) NS_Realloc(void* aPtr, size_t aSize);
XPCOM_API(void) NS_Free(void* aPtr);
#else
#define NS_Alloc moz_xmalloc
#define NS_Realloc moz_xrealloc
#define NS_Free free
#endif

Since the implementations were removed, it means the first half is never actually used, and all the remaining uses of NS_Alloc/NS_Realloc/NS_Free remaining in the tree are just expanding those macros in the second half.
Assignee: nobody → mh+mozilla
Comment on attachment 8917670 [details]
Bug 1407838 - Remove the remains of NS_Alloc/NS_Realloc/NS_Free.

https://reviewboard.mozilla.org/r/188610/#review193864

Stealing review. r=me
Attachment #8917670 - Flags: review+
Comment on attachment 8917671 [details]
Bug 1407838 - Replace UniquePtr<T, NSFreePolicy> with UniqueFreePtr.

https://reviewboard.mozilla.org/r/188612/#review193866

Stealing review. r=me. I like how you removed two copies of NSFreePolicy.
Attachment #8917671 - Flags: review+
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/4fe5de05caba
Remove the remains of NS_Alloc/NS_Realloc/NS_Free. r=njn
https://hg.mozilla.org/integration/autoland/rev/2bd833fbe449
Replace UniquePtr<T, NSFreePolicy> with UniqueFreePtr. r=njn
Comment on attachment 8917670 [details]
Bug 1407838 - Remove the remains of NS_Alloc/NS_Realloc/NS_Free.

*shakes fist at njn for padding review statistics*
Attachment #8917670 - Flags: review?(nfroyd)
Attachment #8917671 - Flags: review?(nfroyd)
> *shakes fist at njn for padding review statistics*

Never fear, glandium's mozjemalloc refactoring work has been padding my review statistics plenty already :)
You need to log in before you can comment on or make changes to this bug.