From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: How to add pseudo vector types Date: Sun, 25 Jul 2021 22:10:12 -0700 Message-ID: <861r7l7j9n.fsf@stephe-leake.org> References: <83h7gw6pyj.fsf@gnu.org> <83czri67h0.fsf@gnu.org> <46BBFF88-76C3-4818-8805-5437409BEA93@gmail.com> <83wnpq46uk.fsf@gnu.org> <533BD53B-4E85-4E9E-B46A-346A5BBAD0F5@gmail.com> <258CB68D-1CC1-42C8-BDCD-2A8A8099B783@gmail.com> <1a776770-50b7-93cd-6591-c9a5b3a56eb8@gmail.com> <8335s64v10.fsf@gnu.org> <5380C92B-6C15-4490-A1E0-1C3132DBB16A@gmail.com> <83k0li2shw.fsf@gnu.org> <83eebq2mpy.fsf@gnu.org> <83lf5w26e3.fsf@gnu.org> <83eebo1c9z.fsf@gnu.org> <86wnpe6znx.fsf@stephe-leake.org> <837dhew6r5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33591"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (windows-nt) Cc: casouri@gmail.com, emacs-devel@gnu.org, cpitclaudel@gmail.com, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 26 07:11:00 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m7stI-0008Yj-3Q for ged-emacs-devel@m.gmane-mx.org; Mon, 26 Jul 2021 07:11:00 +0200 Original-Received: from localhost ([::1]:43080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7stH-0000tV-50 for ged-emacs-devel@m.gmane-mx.org; Mon, 26 Jul 2021 01:10:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7ssc-0008Ve-Pk for emacs-devel@gnu.org; Mon, 26 Jul 2021 01:10:18 -0400 Original-Received: from gateway22.websitewelcome.com ([192.185.46.152]:19669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7ssa-0004hi-FN for emacs-devel@gnu.org; Mon, 26 Jul 2021 01:10:18 -0400 Original-Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 86FFFC4D9 for ; Mon, 26 Jul 2021 00:10:15 -0500 (CDT) Original-Received: from host2007.hostmonster.com ([67.20.76.71]) by cmsmtp with SMTP id 7ssZmUBVJMGeE7ssZmsQiR; Mon, 26 Jul 2021 00:10:15 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stephe-leake.org; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FKe+A28LOOE2WXAcVw8+KYSWNHTACJQErRZ+NA2ntfo=; b=JORs6nNxWlU8mzpfMfXTTirpVf ZUOSys813omhy/SAsogaHgpoBV3sZvmnhDGqW9axq1NEBcM5guLMN6JztVdIFGKBLjGTLk1xVDqJP mdRyplk4krESE6aK+QqUy3rwgadi4KNm2FUc2EHjfKrEpawDErVb0hoxoP59jUjBf9ikwppsLu2Is GFrM7U5UCo1aaB9yVFr8hyn+DXhQyy43anpfYz/LmZ/S/cNZ2dZy5E9BTjhf3KLEx9h3tfICDAxf6 GVk4e0hL8Lb95Sgqi4uuS9EQ8v+WcKp0nBhLnrlC829w9cn2dBB0cdORzUs53oKdQQF/Cv3UbDobZ tYC1iiIw==; Original-Received: from [76.77.182.20] (port=58963 helo=Takver4) by host2007.hostmonster.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m7ssY-003vJP-Q7; Sun, 25 Jul 2021 23:10:14 -0600 In-Reply-To: <837dhew6r5.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 25 Jul 2021 22:09:02 +0300") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2007.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stephe-leake.org X-BWhitelist: no X-Source-IP: 76.77.182.20 X-Source-L: No X-Exim-ID: 1m7ssY-003vJP-Q7 X-Source-Sender: (Takver4) [76.77.182.20]:58963 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 8 X-Source-Cap: c3RlcGhlbGU7c3RlcGhlbGU7aG9zdDIwMDcuaG9zdG1vbnN0ZXIuY29t X-Local-Domain: yes Received-SPF: permerror client-ip=192.185.46.152; envelope-from=stephen_leake@stephe-leake.org; helo=gateway22.websitewelcome.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271631 Archived-At: Eli Zaretskii writes: >> From: Stephen Leake >> Cc: Yuan Fu , cpitclaudel@gmail.com, >> monnier@iro.umontreal.ca, emacs-devel@gnu.org >> Date: Sun, 25 Jul 2021 11:01:22 -0700 >> >> >> How do we handle such thing in Emacs? >> > >> > We use xmalloc, which calls memory_full when allocation fails, which >> > releases some spare memory we have for this purpose, and tells the >> > user to save the session and exit. >> >> I'm thinking about how this applies to wisi, when migrating to a module. >> >> Ada has a built-in allocator; it's probably possible to change that, but >> I'd like to understand exactly why we need to do that. > > We need that to allow the user to save the session while he/she can. > >> The Ada allocator throws an exception on allocation fail; is it >> sufficient to turn that exception into an elisp signal, and arrange for >> elisp to call memory_full (or take some other action, like killing the >> parser)? > > What is a "lisp signal" in this context? The module interface layer of wisi.el would do: (signal 'error "parser ran out of memory") >> Another possible reason to change the Ada allocator is if we want to >> expose Ada memory pointers directly to elisp, as Yuan Fu wants to do for >> tree-sitter (I don't plan to do this for wisi). Does that require that >> the pointers be allocated by the same allocator? > > Same allocator as what? As other lisp symbols. >> I'm not clear what that would mean for the garbage collector; is it >> then expected to recover the tree-sitter-allocated memory for the >> tree? or does it ignore those lisp objects? > > It depends on which Lisp object you wrap those pointers. User-pointer > object allow you to provide your own "finalizer" function. Ok, that would work. -- -- Stephe