Re: Recognising pointers during garbage collection?

Basile STARYNKEVITCH <basile@starynkevitch.net>
4 Sep 2003 01:08:44 -0400

          From comp.compilers

Related articles
[7 earlier articles]
Re: Recognising pointers during garbage collection? qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) (2003-07-25)
Re: Recognising pointers during garbage collection? cymric73@hotmail.com (Maarten D. de Jong) (2003-07-25)
Re: Recognising pointers during garbage collection? basile@starynkevitch.net (Basile STARYNKEVITCH) (2003-07-31)
Re: Recognising pointers during garbage collection? basile@starynkevitch.net (Basile STARYNKEVITCH) (2003-07-31)
Re: Recognising pointers during garbage collection? gneuner2@comcast.net (George Neuner) (2003-07-31)
Re: Recognising pointers during garbage collection? fjh@cs.mu.oz.au (Fergus Henderson) (2003-08-04)
Re: Recognising pointers during garbage collection? basile@starynkevitch.net (Basile STARYNKEVITCH) (2003-09-04)
Re: Recognising pointers during garbage collection? nmm1@cus.cam.ac.uk (2003-09-04)
| List of all articles for this month |

From: Basile STARYNKEVITCH <basile@starynkevitch.net>
Newsgroups: comp.compilers
Date: 4 Sep 2003 01:08:44 -0400
Organization: http://lesours.starynkevitch.net/ - Les Ours
References: 03-07-149 03-07-168 03-07-186 03-07-204
Keywords: GC
Posted-Date: 04 Sep 2003 01:08:37 EDT

In an older article, I (Basile) wrote previously:


Basile>> For example, Qish is a precise, generational copying, garbage
Basile>> collector for (and in) C.


For completeness, the URL for Qish is
http://freshmeat.net/projects/qish or
http://www.starynkevitch.net/Basile/qishintro.html and Qish is
opensource, LGPL license.


but Fergus Henderson added (on 2003-08-03 21:23:01 PST)


Fergus> That is not a particularly good example, IMHO, since Qish is
Fergus> not written in standard C; it relies on undefined behaviour.


I don't believe it is true (at least for the latest Qish version 0.9,
which was released around february 23rd 2003).


Qish does rely on volatile pointers, but it does not need the
-fvolatile flag (or any particular compilation flag) - even if I did
claimed incorrectly in previous releases that Qish needs such flags. I
checked with ths ISO90 C spec lately.


I apologise for having wrongly stated in previous releases that some
particular compilation flags are needed. I do think that every correct
C compiler can compile Qish code (provided the compiler does follow
the volatile keyword correctly...)


So the correct use of Qish is to:


1. have all GC pointers declared as volatile;


2. have all local GC pointers put into a volatile struct named
_locals_


3. more generally follow appropriately the [restrictive] Qish coding
      style (which includes the above 2 rules), in particular avoid
      imbricated functions calls like f(g(h(x),y),z) and call appropriate
      prologue & epilogue macros.


Could Fergus (or others) please examine the latest (0.9) version of
Qish and tell exactly what is undefined behavior in Qish. Please read
and discuss the code, which is more correct than the (poor)
documentation.


Actually, I think that the previous versions of Qish did not need any
particular compiler flag neither, but I failed to understand that when
releasing it. It is a matter of precisely understand the meaning of
volatile.




--


Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email:
basile<at>starynkevitch<dot>net aliases: basile<at>tunes<dot>org =
bstarynk<at>nerim<dot>net 8, rue de la Fa´encerie, 92340 Bourg La
Reine, France



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.