Re: C++ Garbage Collector on VMS?
- From: sol gongola <sol@xxxxxxxxxxx>
- Date: Wed, 18 Apr 2007 09:07:42 -0400
Johann 'Myrkraverk' Oskarsson wrote:
David J. Dachtera <djesys...@xxxxxxxxxxxxxxxx> writes:
Johann 'Myrkraverk' Oskarsson wrote:David J. Dachtera <djesys...@xxxxxxxxxxxxxxxx> writes:...which illustrates the difference in paradigm.
I have to ask: Why does a programming language (other than anMaybe I'm implementing one in C++ and don't want to write my own
interpretive environment) need a "garbage collector"??!!
garbage collector? Boehm GC, afaict, is very popular among such
projects.
You're looking for something you think you need.
I'm asking why you need something that should never be needed. If a
compiled/linked program still needs garbage collection, either the
run-time, the program or both are seriously deficient.
You assume a GC should never be needed. I don't know what kind of
applications you're thinking of, but as I'm creating a lisp engine,
and the language is designed for a GC (and I believe the first GC was
I am not sure why you need a system based garbage collection scheme
or how it relates to what you are doing in lisp. I don't know much
about the Boehm GC nor what triggers its doing a garbage collection
so please excuse my ignorance if the following is not relevant.
Lisp wasn't designed for a GC. The GC was a necessity because of the
way Lisp functioned. As atoms and expressions were created, their
definitions and pointers were given "memory" from a free area.
There were no "alloc" functions available at that time. A running
application was loaded by the system into memory and given the
memory area it requested. Lisp was loaded into memory with a defined
contiguous area it used as a free space.
As Lisp continues executing, atoms/expressions are allocated. When
these "objects" were no longer pointed to, they were not placed back
into the free area. Doing so would have involved to much maintenance
code to keep track of what was being referenced.
When memory needed to be allocated and there wasn't any left to give,
lisp hiccuped and went into a garbage collection mode tracking down
all the referenced memory areas and then chaining everything else
into a new free list.
If you are creating a lisp engine and you are doing it the same way as
original lisp, you do need a garbage collector. Your other options are
to painfully code to keep track of what is in use and what isn't using
counters to keep track of pointers to a object and adding it back to the
free list when the count went to zero. I don't think you can use system
allocate and deallocate calls and let the system keep track of memory usage
since you still would need to know when to tell the system to free up
memory.
Of course, your lisp machine is probably being designed to not have a
maximum memory limitation. That complicates things. The original lisp
died when you ran out of memory.
written for the first lisp engine, but I can be wrong). There are
several run time environments that do GC that work on VMS. Java is
one, Oberon is another. There are probably more that I can't name
righ now? Are those run-time environments *wrong*? Or do you just
want them gone from VMS?
This is a toy project right now, and doesn't deserve the effort of a
custom built GC. I'd like it to work on VMS, but the lack of aparent
VMS support of the Boehm GC has me stomped.
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
The GC needs some system dependent details, such as register contents,
stack and heap locations, and so forth to function properly. I don't
know enough about VMS to supply and port Boehm right now.
Johann
.
- Follow-Ups:
- Re: C++ Garbage Collector on VMS?
- From: Michael D. Ober
- Re: C++ Garbage Collector on VMS?
- References:
- C++ Garbage Collector on VMS?
- From: Johann 'Myrkraverk' Oskarsson
- Re: C++ Garbage Collector on VMS?
- From: David J Dachtera
- Re: C++ Garbage Collector on VMS?
- From: Johann 'Myrkraverk' Oskarsson
- Re: C++ Garbage Collector on VMS?
- From: David J Dachtera
- Re: C++ Garbage Collector on VMS?
- From: Johann 'Myrkraverk' Oskarsson
- C++ Garbage Collector on VMS?
- Prev by Date: Re: Process Software: SocketException: function not implemented
- Next by Date: Re: can you handle this?
- Previous by thread: Re: C++ Garbage Collector on VMS?
- Next by thread: Re: C++ Garbage Collector on VMS?
- Index(es):
Relevant Pages
|