Page 1 of 1

Classes and memory usage in C++

PostPosted: Apr 28, 2004 @ 3:26am
by j.edwards

PostPosted: Apr 28, 2004 @ 4:31am
by joshbu [MSFT]

PostPosted: Apr 28, 2004 @ 4:54am
by j.edwards

PostPosted: Apr 28, 2004 @ 4:01pm
by mlepage
There is a syntax called "placement new" which will allow you to construct an object into existing, preallocated memory. I'm not sure if it is supported in eVC3 or eVC4, but if it is, that's another way to do what you want, without writing your own new operator.

Don't do arcane casting tricks. They are dangerous and there are other, proper ways to do what you want.

PostPosted: Apr 28, 2004 @ 4:48pm
by Kzinti
Implementing operator new (and delete) inside his classes is the best (and cleaness) way to do it. Placement new would be the hack to stay away from.

PostPosted: Apr 28, 2004 @ 9:48pm
by hm

PostPosted: Apr 28, 2004 @ 10:23pm
by Kzinti

PostPosted: Apr 29, 2004 @ 6:12pm
by joshbu [MSFT]

PostPosted: Apr 29, 2004 @ 6:36pm
by Kzinti

PostPosted: Apr 29, 2004 @ 6:37pm
by mlepage

PostPosted: Apr 29, 2004 @ 6:56pm
by Kzinti

PostPosted: Apr 29, 2004 @ 7:05pm
by mlepage