Porting libgc to the AS/400

Peter Colson <pcolson-eepq2T/[email protected]> Fri, 15 Oct 2004 14:20:05 +1000
Newsgroups gmane.comp.systems.as400.open-source
Message-ID <[email protected]>
Hello,

I'm trying to port an open source mark-and-sweep garbage collector, the 
Boehm-Demers-Weiser garbage collector, or libgc for short, from 
Linux-world to the 400. This is one component of a larger application.

I'm also posting this to the MI list due to the low-level nature of the 
discussion. I notice that there's not a lot of traffic on this list, 
but hopefully I can get some feedback on what
is a real attempt to port some open source Linux material to the 400.

First some background: the code in libgc makes an attempt to create a 
"root set" built from statically allocated global variables, stack 
allocated local variables, and registers in active procedures. The root 
set provides a starting point for a search of the heap for objects 
reachable from the root set. The heap space items are then either 
marked as "in use" or not (for later sweeping of unused heap space into 
a free list for re-allocation). Depending on the platform it is also 
possible to examine objects in the heap for type information which aids 
the garbage collector in it's search.

Now, in libgc, the area of code that examines registers tries to push 
these values onto the stack using, in the generic case, some C setjmp() 
trickery, or, on platforms where the generic case won't work, by using 
native assembler code.

My questions are:

1). Do you think libgc could be ported to the 400? (General question, I 
know...)
2). If scanning of static and stack memory plus active registers is 
required in libgc, which of these elements
apply on the 400 platform (for a C program). Static and stack I would 
have thought obvious, but registers? MI
provides no concept of registers, w-code I'm unfamiliar with and it 
seems documentation is hard to come by?
3). If there is indeed a need to access "registers" that are active 
within a C procedure, can this be done via w-code in the
same way that native assembler can be included in C on other platforms?
4). I'm still deciphering the code in libgc related to accessing the 
stack but am wondering about the ability to do this on the 400 as well 
(again in a C program).


Regards,
Peter Colson.

_______________________________________________
This is the Open Source Software for the AS400/iSeries (OSS400) mailing list
To post a message email: OSS400-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/oss400
or email: OSS400-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/oss400.