|
From: Lane R. <la...@if...> - 2005-01-24 20:21:48
|
on Mon, Jan 24, 2005 Roger Holmes may have said: >For my remaining 'slack' time I would like your opinions on the >possible use of C++ memory >allocation and construction facilities. On Macintosh I think that using >statements like: > > E3ClassInfo* theInfo = new E3ClassInfo ; > >E3ClassInfo* theClass = (E3ClassInfo*) Q3Memory_AllocateClear ( sizeof >( E3ClassInfo ) ) ; > >are (except for the zeroing of the block of memory) equivalent as they >both end up calling >malloc to actually reserve the memory. Am I correct, and what is the >situation on the other >platforms? Actually, after a bit of thought I do not believe these are the same: new - get a chunk of memory via some unknown allocator. AllocateClear - get a chunk of memory via a known allocator, and CLEAR it (ie, memset(p,0,size) of similar), plus whatever mem debugging may be going on. Lane Roathe President Ideas From the Deep <http://www.ifd.com> ___________________________________________________________________ If we aren't supposed to eat animals, why are they made with meat? |