<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thank you Gary.<div>So now I can "count" all the final values in an instance.</div><div>Does the instance itself take any memory? how much that is...</div><div><br></div><div>If I have an instance like</div><div><br></div><div>(class</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(slot1 value 12)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(slot2 value "zer")</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(slot3 value nil)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(slot4 value 4.3456)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(slot5 value "normal"))</div><div><br></div><div>I'd be able to count the 12 "zer" 4.3456 and "normal"</div><div><br></div><div>but not the instance itself. </div><div>how much does it take in memory to administrate a slot ? </div><div>that is an instance of the slotdefinition class ?</div><div>if I dont use any accessors readres or writers. (only slot-value for everthing)</div><div><br></div><div>thank you again.</div><div><br></div><div>very sincerely</div><div>joakim</div><div><br></div><div><br></div><div><div><div>Le 13 avr. 10 à 12:42, Gary Byers a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br><br>On Tue, 13 Apr 2010, Joakim Sandgren wrote:<br><br><blockquote type="cite">This I could do. I already make my own "deep-copy" functions.With the Sizeof<br></blockquote><blockquote type="cite">function proposed by A. Repenning it could give me an idea of a size.<br></blockquote><blockquote type="cite">I think I could try to handle myself the case where I have the real instance<br></blockquote><blockquote type="cite">or a pointer. <br></blockquote><blockquote type="cite">I think its quite "tactile" my object. I have staff, section, partial<br></blockquote><blockquote type="cite">section, measure, partial measure ,note group, note. <br></blockquote><blockquote type="cite">all these are (what I understand) "real" instances. but then for example in<br></blockquote><blockquote type="cite">the notes I have next note and preceding note, wich is then referenced. <br></blockquote><blockquote type="cite">so when I do the walker I dont look at them...<br></blockquote><blockquote type="cite">And in the end in all the slots there are integers or floats..., or Strings.<br></blockquote><blockquote type="cite">How do I get the size of a string ? length * x.<br></blockquote><br>The SIZEOF a SIMPLE-STRING is its length * 4, + the size of a header (4 bytes<br>in 32-bit CCL, 8 bytes in 64-bit CCL), rounded up to an object alignment boundary<br>(8/16 bytes.) The SIZEOF function that I mailed out yesterday should know how<br>compute this value.<br><br>For STRINGs that aren't SIMPLE-STRINGs, the answer's more complicated. The<br>STRING will be a fixed-sized object that (possibly transitively) refers<br>to some SIMPLE-STRING. SIZEOF would return a consistent answer on such<br>a string (whatever that answer is depends on word size), but it may not<br>be a particularly interesting answer (and would have nothing to do with<br>the length of the string.)<br><br>This probably counts as another example of a "somewhat opaque implementation-<br>level data structure."<br><br><blockquote type="cite">Very sincerely<br></blockquote><blockquote type="cite">Joakim<br></blockquote><blockquote type="cite"></blockquote></div></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><font class="Apple-style-span" color="#595959" face="'Trebuchet MS'"><br class="Apple-interchange-newline"><br></font></div><div><font class="Apple-style-span" color="#595959" face="'Trebuchet MS'"><br></font></div><div><font class="Apple-style-span" face="'Trebuchet MS'" color="#595959">Joakim Sandgren</font></div><div><font class="Apple-style-span" face="'Trebuchet MS'" color="#595959">joakim sandgren musik</font></div><div><font class="Apple-style-span" face="'Trebuchet MS'" color="#595959">42, rue de Maubeuge</font></div><div><font class="Apple-style-span" face="'Trebuchet MS'" color="#595959">75009 Paris</font></div><div><font class="Apple-style-span" face="'Trebuchet MS'" color="#595959">France</font></div><div><font class="Apple-style-span" face="'Trebuchet MS'" color="#595959">+33 (0)1 45 26 43 90</font></div><div><font class="Apple-style-span" face="'Trebuchet MS'" color="#595959"><a href="mailto:info@joakimsandgren.com">info@joakimsandgren.com</a></font></div><div><font class="Apple-style-span" face="'Trebuchet MS'" color="#595959"><a href="http://www.joakimsandgren.com/">http://www.joakimsandgren.com</a></font></div></span> </div><br></div></body></html>