This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Determination of argument passed to operator new


Hi all,

According to what I've read, the "new" and "new []" expressions are implemented by the compiler to compute the size of the storage required by the type and then make a call to one of the "new" operators to allocate memory and handle construction. I've found the code for the "new" operators in gcc, but I can't find where in the gcc code the compiler determines the value to be passed to the new operator and then sets up the actual call.

The reason I'm asking is I am interested in how the compiler implements the "new []" expression. In particular, how it is storing the array size and is there any extra overhead being stored and what it is, if any.

I'm assuming it is the actual parser/code generator that is doing this since they are unique expressions and not simply function calls. Can someone point me to where this code is being generated or correct my ignorance if I am way off base?

Thanks,

Nik


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]