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

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Dec 11 22:15:27 CET 2005

On 11 Dec 2005, at 22:00, L505 wrote:

> Where is the "reference count" actually stored anyway, and who as  
> access to the
> reference count - just the dll/exe who created the string, or is it  
> accessible by
> both of them? I do need to learn more about reference count science.

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.


More information about the fpc-devel mailing list