Re: [fpc-devel] Improving Ref Counting
peter green wrote: > surely this also means > > 1: there has to be rtti for every field in every class so the compiler can > follow the paths from the class That's almost required, not only for classes but for all data types that contain references (pointers) to managed objects. It's not necessarily RTTI where such information resides, the compiler (Delphi, at least) already maintains such tables for fields with reference counted data types. These tables are used in the Initialize and Finalize procedures of every data structure. > 2: you can't safely cast between classes and untyped pointers or integers > (because those refs would be invisible to the gc) It's a matter of the compiler specific handling of managed objects. Remember that dynamic strings (AnsiString), arrays etc. and their casts already have to be handled by the compiler. You'll encounter no problems with pointers as long as the objects are kept alive by references which GC recognizes. Consider an AnsiString and an PChar into the string, then the pointer will become invalid when the string is moved or destroyed. Likewise a pointer to an object will become invalid when the object is destroyes. These are situations which you'll have to consider already, even without GC. > 3: the GC can't work with pointers to things for every class GC doesn't have to know about pointer types, it's sufficient to determine that an object at an address (pointer value) is referenced and consequently is alive. When such an object has fields with further references, then GC certainly must know about the data type of the object. That's why managed objects usually have a somewhat fixed standard layout, so that GC can find the class type and layout of the object from e.g. the VMT pointer. Alternatively managed objects can have an additional (hidden) reference to the layout information, stored before the begin of the object. Such a preamble also is used by classic memory managers, though with different contents, so that the MM can return the memory to the free memory pool when the object is free'd with e.g. FreeMem, Dispose or Destroy. At this level GC and traditional MM are not very different ;-) DoDi ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Compiling error: Invalid Floating point operation
> You are not the only one, it happens to me too, using windows xp sp2 on > a Pentium4 2.6 Ghz, but not using windows 2k on a Pentium4 1.5Ghz. ok, at least I'm not alone! ;)) Have you tried to play with min and max currency? I reduced the values as first try, but I could try to understand the actual limits. Bye Uberto ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Compiling error: Invalid Floating point operation
[EMAIL PROTECTED] wrote: Compiling current cvs version on Windows XP (cpu Athlon XP 1800) give me Invalid Floating point operation in /rtl/objpas/sysutils/sysstrh.inc 49: I fixed it decreasing MaxCurrency by 1.0 and increasing MinCurrency by the same quantity. I didn't investigate it further. But I'm wondering why I'm the only one with this problem. sysstrh.inc is version 1.15 last change by peter at 2005/2/14 17:13:31 You are not the only one, it happens to me too, using windows xp sp2 on a Pentium4 2.6 Ghz, but not using windows 2k on a Pentium4 1.5Ghz. Also Florian could not reproduce this problem, but somebody else on the Lazarus list reported this too. Vincent. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
[fpc-devel] Compiling error: Invalid Floating point operation
Compiling current cvs version on Windows XP (cpu Athlon XP 1800) give me Invalid Floating point operation in /rtl/objpas/sysutils/sysstrh.inc 49: I fixed it decreasing MaxCurrency by 1.0 and increasing MinCurrency by the same quantity. I didn't investigate it further. But I'm wondering why I'm the only one with this problem. sysstrh.inc is version 1.15 last change by peter at 2005/2/14 17:13:31 Bye Uberto ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] ctypes for the xutil unit
Nikolay Nikolov wrote: I'm not sending the .diff, because it was larger than the actual new file :) Just caught a bug in my xutil conversion, so here's a fix for the fix :) 104c104 < value : cuchar; --- > value : Pcuchar; ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel