Hrvoje Niksic writes:
Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
> So the question is now: Is XEmacs used at all on platforms which do
> require a true read-only purespace.
Kyle reported that BSD/OS uses a read-only purespace. Anyway, I think
you are misusing the word "require". In my opinion, read-only
purespace is a *feature*. We want the purespace to be shared. In
this case, we *don't* want the mythical COW.
As Olivier mentioned, the pages should be sharable so ong as
we don't write to them. But this means that we can't run the
mark-sweep GC over read-only objects. Once the objects have
been marked, poof, no more shared pages. But this is OK,
because we really don't want to GC these objects anyway, and
we might as well save time by not looking at them during GC.
The fact that read-only objects can't be GC'd also happens to be
the reason why the read-onlyness of these objects needs to be
enforced by the OS. If it isn't enforced, we can get crashes.
Example: If a supposedly read-only Lisp cons is modified to
contain a reference to a normal read-write Lisp object, the GC
won't see that reference. If there are no other reference to
the read-write object, it will be collected. We'll crash later
if we use the still-existing reference to the collected object
that exists in the read-only object.
In summary, if we want shared dumped pages, we can't GC the shared
objects. And if we can't GC the objects, the read-onlyness of the
object needs to be enforced to prevent weird GC related crashes
down the road.