× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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 open source list, but am posting here too as there doesn't seem to be much activity on that list and the question is related to lower level MI and, maybe, w-code capability.

Given that this list appears to contain some very in depth knowledge re. MI, w-code and low-level AS/400 issues I thought it would be worth posting here.

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.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.