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: Wed, 09 Jul 2014 18:18:02 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1405035520 14440 80.91.229.3 (10 Jul 2014 23:38:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Jul 2014 23:38:40 +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 Fri Jul 11 01:38:33 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 1X5Nv6-0005jW-0D for ged-emacs-devel@m.gmane.org; Fri, 11 Jul 2014 01:38:32 +0200 Original-Received: from localhost ([::1]:40923 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Nv5-0001QD-7n for ged-emacs-devel@m.gmane.org; Thu, 10 Jul 2014 19:38:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X50Bn-0005e4-Os for emacs-devel@gnu.org; Wed, 09 Jul 2014 18:18:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X50Bg-0003lx-1w for emacs-devel@gnu.org; Wed, 09 Jul 2014 18:18:11 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:1329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X50Bf-0003lr-SI for emacs-devel@gnu.org; Wed, 09 Jul 2014 18:18:03 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVNLd+D9/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0EhQYDSSIBAjSGReOegeEOASpGYFqg0wh X-IPAS-Result: ArUGAIDvNVNLd+D9/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0EhQYDSSIBAjSGReOegeEOASpGYFqg0wh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="77013420" 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; 09 Jul 2014 18:18:02 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id ADE3D60A86; Wed, 9 Jul 2014 18:18:02 -0400 (EDT) In-Reply-To: (=?windows-1252?Q?=22Aur=E9lien?= Aptel"'s message of "Wed, 9 Jul 2014 23:02:52 +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:172954 Archived-At: > It should work but I've ran into a strange problem: the doc field is > set correctly in step a) but the field becomes either an invalid lisp > object or garbage at step b). [...] > It suspect it has to do with garbage collecting since I have not done > anything special to protect the doc field. I'm not sure how to > proceed. Right. You need to tell the GC to trace this new field. Look at the mark_object function in alloc.c. 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. Or maybe force those `doc' references to be kept alive by adding globally reachable references to them (e.g. have a global list of all the cons cells you ever added to such a `doc' field, and then `staticpro' that list). Stefan