Which library has the definition for the global new and the delete operator? Specifically which file in the library contains the definition for these operators?
Which library has the definition for the global new and the delete operator? Specifically
Share
The non-placement forms of
operator newandoperator delete(and their array forms) are declared implicitly in the global scope in every translation unit.The standard placement forms are declared in
<new>.The definitions of library functions are not generally available. Your supplier might supply the source, in which case they will be in there somewhere.
Although, from your comments, you may be talking about the use of
newin a new-expression, rather than theoperator newfunction that allocates memory. The new-expression is handled by the compiler, generating the necessary calls tooperator newand the object(s) constructor(s). There probably won’t be a specific implementation of this anywhere; you’d need to look at the relevant part of the compiler’s code generator.