RE: [fpc-pascal] Question on how to avoid memory trouble

2007-02-05 Thread Cox, Stuart TRAN:EX
Shucks everybody...

I think that its great that the hornet's nest that I stirred up might
mean that a new unit of container classes gets written.  I didn't think
that my seemingly simple problem would create such a cascade of
interest.  Lists are catalysts for invention!

My trouble remains that I seem unable to devise or use canned routines
to get the names of all the files on my drive.  Just writing them out to
con: in a console application would be acceptable to me to get me
started.  TurboPower's technique in their SysTools seemed simple enough
but I seem to have created a monster.

Does somebody have something in source that they'd share with this poor
guy, please?

Stu Cox

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jason P
Sage
Sent: Sat, February 3, 2007 5:13 PM
To: fpc-pascal@lists.freepascal.org
Subject: [fpc-pascal] Question on how to avoid memory trouble

>The error is not from a lack of stack space, either.  The error is 
>EOutOfMemory that indicates a less easily solved problem.

>Can anyone recommend a method to search a whole drive, of arbitrary 
>size, without running out of memory.

>Stu Cox

This is exactly the kind of thing my string class works great with. 

It's a dynamic double linked list - and the way its set up - there are
three versions - the simple tracks just pointers, the next has name,
value and Description ansistrings and I make pretty huge lists with it,
and it has Append, insert, findfirst, findnext, etc. I have an
unofficial release on www.jegas.org and you need to use the compile
switch that allows += construct.

Fpc -Sc  yourprogram.pas   

Worth a shot.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Question on how to avoid memory trouble

2007-02-05 Thread Wayne Sherman

I think that its great that the hornet's nest that I stirred up might
mean that a new unit of container classes gets written...

...My trouble remains...


Getting a better containers unit is nice, but the root of the problem 
seems to be the memory manager.  Delphi's old memory manager had 
fragmentation issues also.  That is why NexusMM, BucketMM and FastMM we 
created.  FastMM is now included with Delphi as the main memory manager. 
 Not only does it solve memory fragmentation issues, it is much faster 
than the old memory manager (especially in multithreaded apps).


FastMM is open source, has anyone ported it to FPC?

I seem to recall that when it began to be used in Delphi, it uncovered 
lots of memory bugs in the IDE and runtime.  When these were fixed, 
Delphi became a much more stable product.


Wayne
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] support for FreeBSD4 broken in fpc 2.0.4

2007-02-05 Thread Marc Santhoff
Am Sonntag, den 28.01.2007, 22:55 +0100 schrieb Marco van de Voort:
> > Am Freitag, den 26.01.2007, 22:31 +0100 schrieb Marco van de Voort:
...
> > 1. reconstructed the original cprt0.as
> 
> Yes. Also note the version numbers in the abitag (currently 504000 meaning
> 5.4).
> 
> > 2. recompiled fpc-2.0.4 release sources
> > 3. added "-Xf" to my .fpc.cfg
> > 4. tried a complete compile of lazarus and a testing program of mine
> 
> Don't. First start to get a simple file working, not directly lazarus. Start
> with 2.0.2 cprt0.as and start modifying that. I think that is easier than
> working backwards from 2.0.4
> 
> > But sadly I were not successful, the only error I get is the same as
> > before, initializing tls fails:
> 
> There is no TLS in 4.x. So you either left in the tls stuff in your cprt0.as
> reconstruction, or you failed to update the preinstalled version (cprt0.o).

Okay, now it worked. I must have been mixing up things in the first
round, because using fpc 2.0.2's cprt0.as and a full "gmake clean all"
and "gmake install INSTALL_PREFIX=..." did actually do the trick
(verified by compiling lazarus). The missing link from the start on was
the -Xf switch and a clean de- and reinstallation.

So I'm happy but there are some small questions left:

What about the other two items

fpc/share/src/fpc-2.0.4/rtl/freebsd/i386/gprt0.as
fpc/share/src/fpc-2.0.4/rtl/freebsd/i386/prt0.as 

Do they have to be fetched from 2.0.2, too?
What are they good for?

Thanks for your assistance,
Marc



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] GetPropValue and a class property

2007-02-05 Thread Graeme Geldenhuys

Hi

In the help page
 http://lazarus-ccr.sourceforge.net/docs/rtl/typinfo/getpropvalue.html
it mentions that it is not implemented due to missing Variant support.
Is this still true? As far as I know Variant support has been in FPC
for a while now.

I'm using FPC 2.0.4 and FPC 2.1.1 (latest svn).

Now my actual question:  What does GetPropValue return when the
property is a class?
For example I have a Country class and a Address class which holds a
reference to a Country class. As far as I understand GetPropValue
returns a variant.  So how to I cast (or whatever needs to be done) so
I can reference the actual Country instance that GetPropValue
returned?

TAddress = class()
...
published
 property  Street: string read 
 property  Country: TCountry read FCountry;
 ...
end;


--
Graeme Geldenhuys

There's no place like S34° 03.168'  E018° 49.342'
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal