From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter api Date: Sat, 04 Sep 2021 16:04:44 +0300 Message-ID: <83fsukwkyb.fsf@gnu.org> References: <83r1f7hydn.fsf@gnu.org> <95F37923-5BF9-4D81-B361-267CF119FBCA@gmail.com> <735AF34C-FD18-4A6A-A99D-E5D8EB4DE4F3@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19774"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, theo@thornhill.no, cpitclaudel@gmail.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, stephen_leake@stephe-leake.org To: =?utf-8?Q?Tu=E1=BA=A5n-Anh_Nguy=E1=BB=85n?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 04 15:05:56 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 1mMVMp-0004v8-Rn for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Sep 2021 15:05:55 +0200 Original-Received: from localhost ([::1]:60444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMVMo-00031a-K2 for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Sep 2021 09:05:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMVLl-0001hL-Ov for emacs-devel@gnu.org; Sat, 04 Sep 2021 09:04:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59332) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMVLi-0001wo-SS; Sat, 04 Sep 2021 09:04:46 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4951 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMVLi-0003DA-Di; Sat, 04 Sep 2021 09:04:46 -0400 In-Reply-To: (message from =?utf-8?Q?Tu=E1=BA=A5n-Anh_Nguy=E1=BB=85n?= on Sat, 4 Sep 2021 19:49:35 +0700) 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:273863 Archived-At: > From: Tuấn-Anh Nguyễn > Date: Sat, 4 Sep 2021 19:49:35 +0700 > Cc: Theodor Thornhill , Stephen Leake , > Eli Zaretskii , Clément Pit-Claudel , > Stefan Monnier , emacs-devel > > On Sat, Sep 4, 2021 at 1:44 PM Yuan Fu wrote: > > 1) tree-sitter lacks a way to change its malloc behavior in run-time, I commented on their road-map issue, but no one has replied yet, > > > Do you mean APIs to change its alloc/free functions at run time? Why would we > need to do that? Because what TS does when it runs out of memory is call 'exit'. That's unacceptable for Emacs. Emacs can handle out-of-memory situations well enough, but it can only do that if the problem is reported to it by the memory-allocation functions. > Doesn't simply defining `ts_malloc` and related functions work? No, because we want to be able to link against a TS library, we don't want to require people who build Emacs to build TS as well.