emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic loading progress


From: Stefan Monnier
Subject: Re: Dynamic loading progress
Date: Thu, 10 Jul 2014 14:04:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

>> You could change its handling of PVEC_SUBR such that it calls itself
>> recursively on the `doc' field and then make sure the VECTOR_MARKED_P bit
>> gets reset to false in gc_sweep.
> I understand that marking a symbol which is bound to a subr means we
> have to mark the subr i.e. the doc field since we can't free a subr.
> But why do we need to do something else? The doc string being either a
> cons, an int or a string it will be automatically handled in the
> respective sweep_xxx functions. There are no global list of subr that
> can be swept AFAIK.

The issue is that when we get a vectorlike object, the first thing we
want to do is to check the VECTOR_MARKED_P and stop right there if it's
already marked.

So in order to look inside the Subrs, we'd either have to check SUBRP
before checking VECTOR_MARKED_P (thus slowing doing GC for every one),
or we'd have to make sure that the SUBRP that are dyn-loaded have
a VECTOR_MARKED_P that says false (either always or at least a the
beginning of the GC).

> The first solution is better IMHO, it's more intrusive but it limits
> the scope of the problem to the GC.

I tend to agree.  Maybe resetting VECTOR_MARKED_P on Subrs to false
directly from mark_object (and only if the `doc' field is non-trivial)
is the easiest solution.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]