This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Move non operator new definitions outside of new.cpp
ClosedPublic

Authored by ldionne on Jun 16 2023, 6:42 AM.

Details

Summary

This makes it such that new.cpp contains only the definitions of
operator new and operator delete, like its libc++abi counterpart.

Diff Detail

Event Timeline

ldionne created this revision.Jun 16 2023, 6:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2023, 6:42 AM
ldionne requested review of this revision.Jun 16 2023, 6:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2023, 6:42 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
yronglin added inline comments.
libcxx/src/new_helpers.cpp
25

Nit: Should we use std:: in new code?

Mordante accepted this revision.Jun 16 2023, 9:00 AM
Mordante added a subscriber: Mordante.

LGTM, but I have some remarks.

libcxx/src/new.cpp
10

Is this include still needed?

libcxx/src/new_helpers.cpp
25

We should, but this is moved. (I still like to fix it)

This revision is now accepted and ready to land.Jun 16 2023, 9:00 AM
ldionne marked 3 inline comments as done.Jun 16 2023, 10:35 AM
ldionne added inline comments.
libcxx/src/new.cpp
10

Yes, we use std::malloc.

ldionne updated this revision to Diff 532218.Jun 16 2023, 10:37 AM
ldionne marked an inline comment as done.

Address comments and rebase.