[cfe-dev] missing optimization opportunity for const std::vector compared to std::array

Dennis Luehring dl.soluz at gmx.net
Sat May 31 04:17:58 PDT 2014


Am 30.05.2014 22:50, schrieb Richard Smith:
>   We're not*permitted*  to
> remove those operator new/operator delete calls by the standard, because
> operator new and operator delete can be overridden by the user.
>
> ....
>
> So... we should add some way for std::allocator to say "allocate/deallocate
> memory like a new-expression", and use it in libc++. I think we should add
>
>    void *__builtin_operator_new(size_t)
>    void __builtin_operator_delete(void*)

sounds like an good idea

but i do not understand why its so hard to track overridden allocations 
- or why
they can't be removed - in the end there is an malloc/free or 
__builtin_operator_new/delete



More information about the cfe-dev mailing list