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: Generic stack I can use in C core? Date: Sat, 24 Sep 2022 09:11:24 +0300 Message-ID: <83wn9tnvxv.fsf@gnu.org> References: <3C69BDE1-2B31-4FD5-BB8C-81F83116D239@gmail.com> <52CE9A48-5F88-4228-9F12-7C6287FE96D3@gmail.com> <838rm9q28s.fsf@gnu.org> <56706B8D-170F-420D-91C8-6BF888314B21@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="33405"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 24 08:12:34 2022 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 1obyOv-0008Zp-Fe for ged-emacs-devel@m.gmane-mx.org; Sat, 24 Sep 2022 08:12:33 +0200 Original-Received: from localhost ([::1]:46262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obyOt-0002Q2-7o for ged-emacs-devel@m.gmane-mx.org; Sat, 24 Sep 2022 02:12:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obyO2-0001HN-Ox for emacs-devel@gnu.org; Sat, 24 Sep 2022 02:11:38 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43180) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obyO2-0003zW-GH; Sat, 24 Sep 2022 02:11:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ZQWsNmkR2rlsm3YznJb8OJcLFAVv5FOI15b/fJ6ZIHE=; b=rmaW8Ja5Rm2VLbJp8ubo SVdrdlNEDP/4JVEYewYNbx8VxzU+BtTRJpgZ1Kj6clDO3qlumjK9newCln7iB+G7vrqopuqGBQw7U KAgg5EtDQ5bcnDCt6CI3/lpSOnLSpwS0QPMTybFJxN6b2ty2qFzD2azuGQnv5u2etRiivnHiQxWPs vUmFeyePNQhLeqcZNvWPJnlDU9dSZymMyoqjE40f99e9cdw9AWlkZGlDGKp1SSmZL0xWaR9WohUNg /rRVBFI0JCfteN5nf1MtyrTfGpY0tufr50DGY0YH5ef5Hr2P63Rfah2xz8bc9tUtndZmYrNRxICqB MHeTcyfc7lLdgw==; Original-Received: from [87.69.77.57] (port=2400 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 1obyO1-0000J0-Rq; Sat, 24 Sep 2022 02:11:38 -0400 In-Reply-To: <56706B8D-170F-420D-91C8-6BF888314B21@gmail.com> (message from Yuan Fu on Fri, 23 Sep 2022 14:56:23 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:296111 Archived-At: > From: Yuan Fu > Date: Fri, 23 Sep 2022 14:56:23 -0700 > Cc: emacs-devel@gnu.org > > >> *Something that allocates a chunk of memory to store the nodes and automatically grows and shrinks and copies stuff over. > > > > What kind of stuff do you want to store there? > > I want to traverse a tree depth-first using stacks. If there is a generic stack I’ll use that, if not I’ll just use > > struct stack_node { > TSNode node; > TSNode *next; > }; Then I don't think we have anything ready for that, no. In the couple of places where we traverse a tree in depth-first order, we just recurse.