Branch: Tag:

2014-12-04

2014-12-04 19:24:07 by Per Hedbor <ph@opera.com>

Added support for an _object_size method in objects.

If defined the return value from that function will be added to the
size calculated by _object_size.

This is mainly useful to get more correct debug information about
memory usage, as an example when using Debug.pp_object_usage.

Callbacks have currently only been added to Image.Image and
System.Memory.

Currently the normal memory_usge() function does not include these
sizes, it should probably do so, however.

176:    "_types",    "_serialize",    "_deserialize", +  "_size_object",   };      struct pike_string *lfun_strings[NELEM(lfun_names)];
236:    tFuncV(tNone,tVoid,tArray), /* "_types", */    tFuncV(tObj tZero, tVoid, tVoid), /* "_serialize", */    tFuncV(tObj tZero, tVoid, tVoid), /* "_deserialize", */ +  tFuncV(tZero, tVoid, tInt), /* "_size_object", */   };      /* These two are not true LFUNs! */