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]

Question about implementation of new/delete and new[]/delete[] in gnu gcc


Hi All,

I am using debian linux with gcc 4.7.2.

I am curious and want to educate myself about the particular implementations of the operators new, new[], delete and delete[].

Specifically, I was curious about what meta data is stored about the allocations (size/# of elements in the array case), and where that data is stored. I have the source for gcc-4.7.2 and I looked through it, but it was not obvious where to start. I guess I was expecting to see some sort of metadata structure placed in the heap right before the returned pointer but I didn't see anything like that, or at least it was not obvious to me if I was looking at it.

Does anyone know which source files contain the magic? Or better yet, can anyone point me to a design doc that describes the overall strategy?

Thanks!
Tim


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