[fpc-devel] Access Violation with nested DLL'scompiledbyFPC(andsome more info on bug #4538)

L505 fpc505 at z505.com
Wed Dec 14 12:13:53 CET 2005


> 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




More information about the fpc-devel mailing list