From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Thu, 10 Jul 2014 14:04:51 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1405015533 6156 80.91.229.3 (10 Jul 2014 18:05:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Jul 2014 18:05:33 +0000 (UTC) Cc: Emacs development discussions To: =?windows-1252?Q?Aur=E9lien?= Aptel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 10 20:05:26 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X5Iih-00051E-I3 for ged-emacs-devel@m.gmane.org; Thu, 10 Jul 2014 20:05:23 +0200 Original-Received: from localhost ([::1]:39433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Iic-0007Ch-UI for ged-emacs-devel@m.gmane.org; Thu, 10 Jul 2014 14:05:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5IiM-0006u6-Mo for emacs-devel@gnu.org; Thu, 10 Jul 2014 14:05:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5IiC-0001Lg-If for emacs-devel@gnu.org; Thu, 10 Jul 2014 14:05:02 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:31386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5IiC-0001Lc-E0 for emacs-devel@gnu.org; Thu, 10 Jul 2014 14:04:52 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVNLd+D9/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0EhQYDSQuh1YI0hkXjnoHhDgElGKUN4Fqg0wh X-IPAS-Result: ArUGAIDvNVNLd+D9/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0EhQYDSQuh1YI0hkXjnoHhDgElGKUN4Fqg0wh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="77090729" Original-Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 10 Jul 2014 14:04:51 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 39701613BA; Thu, 10 Jul 2014 14:04:51 -0400 (EDT) In-Reply-To: (=?windows-1252?Q?=22Aur=E9lien?= Aptel"'s message of "Thu, 10 Jul 2014 19:21:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:172938 Archived-At: >> 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