Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-03

Boehm GC

14 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ritchie turner

I'm new to fpc and pascal, i.e. I've never done a project in it, but i've been following the lists for a while and dabbling.

I like using a garbage collector and I know you can replace the memory manager in fpc so i guess it's probably trivial to replace the standard with boehm. Wondered if anyone's done it and how they got on, and if there are issues with the idea.

Thanks

bd

Reply by email

Adriaan van Os
to ritchie turner
ritchie turner wrote 7 lines
I'm new to fpc and pascal, i.e. I've never done a project in it, but i've been following the lists for a while and dabbling. I like using a garbage collector and I know you can replace the memory manager in fpc so i guess it's probably trivial to replace the standard with boehm. Wondered if anyone's done it and how they got on, and if there are issues with the idea.

The main issue is that garbage collection is the worst programming idea ever. It lets you get away with bad program design at the cost of slow execution.

Regards,

Adriaan van Os

Reply by email

Jonas Maebe
to Adriaan van Os

Adriaan van Os wrote on wo, 18 mrt 2009:

The main issue is that garbage collection is the worst programming idea ever. It lets you get away with bad program design at the cost of slow execution.

Please post remarks like that to the fpc-other list instead. This list is not about advocacy, but about solving (FPC) Pascal programming problems. Using the Boehm garbage collection with FPC is perfectly on topic, flame wars about how good/bad the concept of garbage collection is, is not.

Thanks,

Jonas
FPC mailing lists admin

---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.

Reply by email

ritchie turner
to Adriaan van Os: The main issue is that garbage collection is the worst programming idea ever. It lets you…

I know it has limitations and downsides but I have to respectfully disagree it's the worst programming idea ever. For the stuff I do which is high level applications I don't believe it's going to affect me badly; If i were writing codecs or an operating system then i would find it hard to justify - however, removing a class of errors from my code should speed up my development and be worth it.

bd

Adriaan van Os wrote 17 lines
ritchie turner wrote: > I'm new to fpc and pascal, i.e. I've never done a project in it, but > i've been following the lists for a while and dabbling. > > I like using a garbage collector and I know you can replace the memory > manager in fpc so i guess it's probably trivial to replace the standard > with boehm. Wondered if anyone's done it and how they got on, and if > there are issues with the idea. The main issue is that garbage collection is the worst programming idea ever. It lets you get away with bad program design at the cost of slow execution. Regards, Adriaan van Os _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Marco van de Voort
to ritchie turner: I'm new to fpc and pascal, i.e. I've never done a project in it, but i've been following…

In our previous episode, ritchie turner said:

Show quoted text 8 lines
I'm new to fpc and pascal, i.e. I've never done a project in it, but i've been following the lists for a while and dabbling. I like using a garbage collector and I know you can replace the memory manager in fpc so i guess it's probably trivial to replace the standard with boehm. Wondered if anyone's done it and how they got on, and if there are issues with the idea.

To my best knowledge nobody has experimented with this with FPC. However I can vaguely remember experiments for Delphi (and then I mean native Delphi) have been done.

Since the memory manager concept exists there too (though a bit more gritty and less cleanly abstracted) and the language base principles are the same, I think trying to find that and studying should give you the best start.

If you get a few steps further in that direction, please report back your findings here.

Reply by email

Krishna
to ritchie turner: I'm new to fpc and pascal, i.e. I've never done a project in it, but i've been following…
ritchie turner wrote 9 lines
I'm new to fpc and pascal, i.e. I've never done a project in it, but i've been following the lists for a while and dabbling. I like using a garbage collector and I know you can replace the memory manager in fpc so i guess it's probably trivial to replace the standard with boehm. Wondered if anyone's done it and how they got on, and if there are issues with the idea.

Very many years ago I asked the same question on this mailing list :)

Check it out here:
http://www.hu.freepascal.org/lists/fpc-pascal/2002-November/004229.html

IIRC, it worked on Win32 with boehmgc linked in as a DLL. Don't remember if it was faster than the default memory manager though.

Cheers,
-Krishna

I love deadlines. I like the whooshing sound they make as they fly by. -- Douglas Adams

Reply by email

Marco van de Voort
to Krishna

In our previous episode, Krishna said:

Show quoted text 17 lines
> > I'm new to fpc and pascal, i.e. I've never done a project in it, but > i've been following the lists for a while and dabbling. > > I like using a garbage collector and I know you can replace the memory > manager in fpc so i guess it's probably trivial to replace the standard > with boehm. Wondered if anyone's done it and how they got on, and if > there are issues with the idea. > Very many years ago I asked the same question on this mailing list :) Check it out here: http://www.hu.freepascal.org/lists/fpc-pascal/2002-November/004229.html IIRC, it worked on Win32 with boehmgc linked in as a DLL. Don't remember if it was faster than the default memory manager though.

I found this:
- http://cc.embarcadero.com/Item/21646

Reply by email

ritchie turner
to Marco van de Voort

Thanks all, I've got something to go on now.

bd.

Marco van de Voort wrote 25 lines
In our previous episode, Krishna said: > > > > I'm new to fpc and pascal, i.e. I've never done a project in it, but > > i've been following the lists for a while and dabbling. > > > > I like using a garbage collector and I know you can replace the memory > > manager in fpc so i guess it's probably trivial to replace the standard > > with boehm. Wondered if anyone's done it and how they got on, and if > > there are issues with the idea. > > > > Very many years ago I asked the same question on this mailing list :) > > Check it out here: > http://www.hu.freepascal.org/lists/fpc-pascal/2002-November/004229.html > > IIRC, it worked on Win32 with boehmgc linked in as a DLL. Don't > remember if it was faster than the default memory manager though. I found this: - http://cc.embarcadero.com/Item/21646 _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Adrian Veith
to ritchie turner: I'm new to fpc and pascal, i.e. I've never done a project in it, but i've been following…
Show quoted text 9 lines
I'm new to fpc and pascal, i.e. I've never done a project in it, but i've been following the lists for a while and dabbling. I like using a garbage collector and I know you can replace the memory manager in fpc so i guess it's probably trivial to replace the standard with boehm. Wondered if anyone's done it and how they got on, and if there are issues with the idea.

It is quite easy to use the boehm gc inside delphi. I did some test a few years ago. Since the fpc memory manager interface is very close to delphi, it should be no problem to port the boehm gc to fpc.

the major disadvantage I see, is, that all the existing code is not gc aware - you loose the benefits of a gc.

cheers,

Adrian.

Reply by email

Krishna
to Marco van de Voort: In our previous episode, Krishna said: I found this: -…
Marco van de Voort wrote 21 lines
In our previous episode, Krishna said: > > > > I'm new to fpc and pascal, i.e. I've never done a project in it, but > > i've been following the lists for a while and dabbling. > > > > I like using a garbage collector and I know you can replace the memory > > manager in fpc so i guess it's probably trivial to replace the standard > > with boehm. Wondered if anyone's done it and how they got on, and if > > there are issues with the idea. > > > > Very many years ago I asked the same question on this mailing list :) > > Check it out here: > http://www.hu.freepascal.org/lists/fpc-pascal/2002-November/004229.html > > IIRC, it worked on Win32 with boehmgc linked in as a DLL. Don't > remember if it was faster than the default memory manager though. I found this: - http://cc.embarcadero.com/Item/21646

not able to download. getting timed out.

anyway, I tried compiling the old code and it failed. TMemoryManager seems to have changed a bit. Adjusted the code to match the cmem example given in the manual and I got errors saying that InitThread , DoneThread and RelocateHeap are undefined fields in TMemoryManager. Compiled fine when those three lines were commented out.

It did not crash on Linux! and it seems to collect as well!! (using libgc 6.6 that comes with opensuse 11.1)

Cheers,
--Krishna

I love deadlines. I like the whooshing sound they make as they fly by. -- Douglas Adams

Reply by email

Krishna
to Krishna
Krishna wrote 33 lines
On Wed, Mar 18, 2009 at 9:04 PM, Marco van de Voort wrote: > In our previous episode, Krishna said: >> > >> > I'm new to fpc and pascal, i.e. I've never done a project in it, but >> > i've been following the lists for a while and dabbling. >> > >> > I like using a garbage collector and I know you can replace the memory >> > manager in fpc so i guess it's probably trivial to replace the standard >> > with boehm. Wondered if anyone's done it and how they got on, and if >> > there are issues with the idea. >> > >> >> Very many years ago I asked the same question on this mailing list :) >> >> Check it out here: >> http://www.hu.freepascal.org/lists/fpc-pascal/2002-November/004229.html >> >> IIRC, it worked on Win32 with boehmgc linked in as a DLL. Don't >> remember if it was faster than the default memory manager though. > > I found this: > - http://cc.embarcadero.com/Item/21646 not able to download. getting timed out. anyway, I tried compiling the old code and it failed. TMemoryManager seems to have changed a bit. Adjusted the code to match the cmem example given in the manual and I got errors saying that InitThread , DoneThread and RelocateHeap are undefined fields in TMemoryManager. Compiled fine when those three lines were commented out. It did not crash on Linux! and it seems to collect as well!! (using libgc 6.6 that comes with opensuse 11.1)

oops! posted too early. mseide with boehmgc segfaults at startup (in GC_find_limit) :-(

Cheers,
--Krishna

I love deadlines. I like the whooshing sound they make as they fly by. -- Douglas Adams

Reply by email

Adrian Veith
to ritchie turner: Guilty! bd.

Hi bd,

than I guess, this is why you look at the boehm gc (that's why I was looking at it). I have put some haxe/neko pascal related code at http://code.google.com/p/pascal4neko/
The code is only tested with delphi, but should work with fpc as well. There is no memory manager for boehm, but some code which shows how to handle the gc for objects and interfaces. If you have any questions, you can contact me directly, because this a bit OT for this list.

Cheers,
Adrian.

Show quoted text 31 lines
Hi Adrian, Guilty! bd. On Wed, 2009-03-18 at 17:03 +0100, Adrian Veith wrote: > ritchie turner schrieb: > >> Thanks all, I've got something to go on now. >> >> bd. >> >> > bye the way - are you black dog from the haxe list ? > > Cheers, > > Adrian. > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email