From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: A question about struct coding_system Date: Mon, 21 Nov 2011 17:55:37 +0100 Message-ID: References: <4ECA78BD.4040904@yandex.ru> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1321894564 28443 80.91.229.12 (21 Nov 2011 16:56:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 21 Nov 2011 16:56:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 21 17:56:00 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RSX9z-0001Dg-5W for ged-emacs-devel@m.gmane.org; Mon, 21 Nov 2011 17:55:59 +0100 Original-Received: from localhost ([::1]:57288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSX9y-0005Fu-Q3 for ged-emacs-devel@m.gmane.org; Mon, 21 Nov 2011 11:55:58 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:49504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSX9s-0005EZ-J4 for emacs-devel@gnu.org; Mon, 21 Nov 2011 11:55:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSX9l-0003Ph-Mt for emacs-devel@gnu.org; Mon, 21 Nov 2011 11:55:52 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.10]:45705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSX9l-0003Oe-HD for emacs-devel@gnu.org; Mon, 21 Nov 2011 11:55:45 -0500 Original-Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id D80E41853B94; Mon, 21 Nov 2011 17:58:26 +0100 (CET) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id 842831C00199; Mon, 21 Nov 2011 17:55:41 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id QhH2M4PQYDfA; Mon, 21 Nov 2011 17:55:39 +0100 (CET) Original-Received: from igel.home (ppp-93-104-134-85.dynamic.mnet-online.de [93.104.134.85]) by mail.mnet-online.de (Postfix) with ESMTP; Mon, 21 Nov 2011 17:55:38 +0100 (CET) Original-Received: by igel.home (Postfix, from userid 501) id 3E869CA29C; Mon, 21 Nov 2011 17:55:38 +0100 (CET) X-Yow: I'm having an emotional outburst!! In-Reply-To: <4ECA78BD.4040904@yandex.ru> (Dmitry Antipov's message of "Mon, 21 Nov 2011 20:13:49 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 212.18.0.10 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:146112 Archived-At: Dmitry Antipov writes: > At a first glance, struct coding_system should be a vector-like > object with src_object and dst_object at the beginning. But it > isn't, and it looks like that src_object and dst_object are never > marked directly. Thus, it should be guaranteed that, for any > coding_system, objects referenced by src_object and dst_object > are always reachable from another live objects. But I can't > find any code that takes care about this, so I don't understand > why and how it works at all :-(. It's generally the duty of the caller to protect the object. If it is a buffer it should be the current buffer. If it is passed in from Lisp it is already protected. Other cases should be explicitly protected. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."