[Openmcl-devel] memory

Joakim Sandgren joakim at joakimsandgren.com
Tue Apr 13 04:03:52 PDT 2010


Thank you Gary.
So now I can "count" all the final values in an instance.
Does the instance itself take any memory? how much that is...

If I have an instance like

(class
	(slot1 value 12)
	(slot2 value "zer")
	(slot3 value nil)
	(slot4 value 4.3456)
	(slot5 value "normal"))

I'd be able to count the 12 "zer" 4.3456 and "normal"

but not the instance itself.
how much does it take in memory to administrate a slot ?
that is an instance of the slotdefinition class ?
if I dont use any accessors readres or writers. (only slot-value for  
everthing)

thank you again.

very sincerely
joakim


Le 13 avr. 10 à 12:42, Gary Byers a écrit :

>
>
> On Tue, 13 Apr 2010, Joakim Sandgren wrote:
>
>> This I could do. I already make my own "deep-copy" functions.With  
>> the Sizeof
>> function proposed by A. Repenning it could give me an idea of a size.
>> I think I could try to handle myself the case where I have the real  
>> instance
>> or a pointer.
>> I think its quite "tactile" my object. I have staff, section, partial
>> section, measure, partial measure ,note group, note.
>> all these are (what I understand) "real" instances. but then for  
>> example in
>> the notes I have next note and preceding note, wich is then  
>> referenced.
>> so when I do the walker I dont look at them...
>> And in the end in all the slots there are integers or floats..., or  
>> Strings.
>> How do I get the size of a string ? length * x.
>
> The SIZEOF a SIMPLE-STRING is its length * 4, + the size of a header  
> (4 bytes
> in 32-bit CCL, 8 bytes in 64-bit CCL), rounded up to an object  
> alignment boundary
> (8/16 bytes.)  The SIZEOF function that I mailed out yesterday  
> should know how
> compute this value.
>
> For STRINGs that aren't SIMPLE-STRINGs, the answer's more  
> complicated.  The
> STRING will be a fixed-sized object that (possibly transitively)  
> refers
> to some SIMPLE-STRING.  SIZEOF would return a consistent answer on  
> such
> a string (whatever that answer is depends on word size), but it may  
> not
> be a particularly interesting answer (and would have nothing to do  
> with
> the length of the string.)
>
> This probably counts as another example of a "somewhat opaque  
> implementation-
> level data structure."
>
>> Very sincerely
>> Joakim
>>




Joakim Sandgren
joakim sandgren musik
42, rue de Maubeuge
75009 Paris
France
+33 (0)1 45 26 43 90
info at joakimsandgren.com
http://www.joakimsandgren.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20100413/3c896d44/attachment.htm>


More information about the Openmcl-devel mailing list