#include <memory>
struct foo { };
int main() { std::make_shared<foo>(); }
The asssembly generated by g++7 -fno-exceptions -Ofast for the code above:
-
Contains a single call to
operator newif-fno-rttiis not passed. -
Contains two separate calls to
operator newif-fno-rttiis passed.
This can be easily verified on gcc.godbolt.org:
Why is this happening? Why does disabling RTTI prevent make_shared from unifying the object and control block allocations?
Aucun commentaire:
Enregistrer un commentaire