> if when someone does pcharvar := ansistringvar or pwidecharvar :=
> widestringvar we increased the refcount every program that used that
> construct would leak memory.

Normally I would aggree with you, but as far as I can see, PWideChar is
also an automated type. (If not then large parts of the variant-code in 
the RTL has to be rewritten, and probably alsoe the wstrings.inc file)

>From wstrings.inc:

  WideString is defined as a 'silent' pwidechar :
  a pwidechar that points to :

  @-8  : SizeInt for reference count;
  @-4  : SizeInt for size;
  @    : String + Terminating #0;
  Pwidechar(Widestring) is a valid typecast.
  So WS[i] is converted to the address @WS+i-1.

So there is a bug somewhere. But if they should not be refcounted, that's
ok. But then I have some fixs for the variant-code

Joost



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

Reply via email to