> The reference count is part of the ansistring itself. An ansistring
> is simply a pointer to a record containing a reference count, the
> amount of memory currently allocated for the string (i.e., maximum
> length -1) and the string itself (a 0-terminated string).
>
> So when passing a string from a dll to somewhere else, its reference
> count is passed along with it.
>

Instead of asking all the newbie questions, I will do more reading about 
reference
count science on my own too.. but if it's easy for you to tell me here, how 
does the
reference count know ahead of time that there will be no usage of the string 
when it
sets the reference count to 0? i.e. how is the reference count decremented? 
Does the
compiler know this at compile time?


Lars

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to