MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: value bytes of error codes



H. Peter Anvin writes:
> > Perhaps I will change the definition of value_bytes() to be more intuitive
> > in 1.8.0p3, by adding 8 to all values it returns.  Of course, I will also
> > make the corresponding change in object_bytes() to make sure no byte of
> > memory is double-charged.
> 
> If you do, you should probably also add the overhead added by the
> memory manager (arena pointer + reference count = 8 bytes?) for
> strings, floats and lists as well as list heads...

I'm not sure what you mean here.  If you mean whatever low-level data
structures might be maintained by the local implementation of malloc(), then
that's hard to get at in a portable manner.  If, by `reference count' you mean
the one maintained by the MOO server itself, that isn't stored in the block of
memory at all, but rather in a separate hash table and, even then, only for
reference counts other than one.

The point of value_bytes() is not to give a complete and total measure of all
direct and ancillary costs of storing that value; it's to give a simply-defined
and accurate metric of just the direct space usage.

	Pavel



Home | Subject Index | Thread Index