A monitor for every object
Robert Jacques
sandford at jhu.edu
Fri Feb 4 20:19:51 PST 2011
On Fri, 04 Feb 2011 16:02:55 -0500, bearophile <bearophileHUGS at lycos.com>
wrote:
> Steven Schveighoffer:
>
>> Most of the time the extra word isn't noticed
>> because the memory size of a class is usually not exactly a power of 2.
>
> I'd like to know in a normal object oriented program how much memory
> this design actually wastes.
>
> Thank you to you and Kagamin for your answers,
> bye,
> bearophile
1 word per object, assuming a uniform distribution of object sizes. Yes,
_most_ objects aren't affected, but the ones that are make up for the
difference by using twice the ram.
More information about the Digitalmars-d
mailing list