From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Generic stack I can use in C core? Date: Fri, 23 Sep 2022 14:56:23 -0700 Message-ID: <56706B8D-170F-420D-91C8-6BF888314B21@gmail.com> References: <3C69BDE1-2B31-4FD5-BB8C-81F83116D239@gmail.com> <52CE9A48-5F88-4228-9F12-7C6287FE96D3@gmail.com> <838rm9q28s.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13488"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 24 00:07:05 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 1obqp7-0003MC-79 for ged-emacs-devel@m.gmane-mx.org; Sat, 24 Sep 2022 00:07:05 +0200 Original-Received: from localhost ([::1]:57482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obqp6-0002v2-6j for ged-emacs-devel@m.gmane-mx.org; Fri, 23 Sep 2022 18:07:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obqer-0006Jq-RK for emacs-devel@gnu.org; Fri, 23 Sep 2022 17:56:30 -0400 Original-Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:35463) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obqeq-0007mr-74; Fri, 23 Sep 2022 17:56:29 -0400 Original-Received: by mail-pj1-x1033.google.com with SMTP id q35-20020a17090a752600b002038d8a68fbso7154048pjk.0; Fri, 23 Sep 2022 14:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date; bh=D/rDFm5Zw2moj1NByXk7BCTP/wGMooXylFBa/aS0cH0=; b=GX49m4LlUj8ve8wyJP+f+LYTJPnKoEyzcIaer46g0Xc7/d+MU43hP6Lz3XoUf6mIxj krqHk+PUAqZFgPuPBcgtShKIgiV7GnV8+1fKIKf6h6Z4z3A26zToE6ltpFQFrz9/l+oD Dxi4ztovrtohlLNA1oBSDwi/YTZKiL9pVQTJ/XiuvozcRazemIlASybfxxUBurQVsnWK TNRe90vmTHcU8yYjO9+dLag6C6Rd/gg7EsgcD6J0bi5IpE0Vr6/tmKLJAG6IUmYeqnsE 2Qhj8x3C9RvqHn2knPp9v5G1uVfyI3QAPPrdAVgifE/dJgw0tislj5hM7hk6vMTxWIwg alMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=D/rDFm5Zw2moj1NByXk7BCTP/wGMooXylFBa/aS0cH0=; b=RZsFTUXCmuycrQc0+m97lw0NcfYnZ/3khDC7Jlhlofyuqhgf3TnEUiWRJrWjKfpkBX z0bb/w+ROba6eM20SlyttzTGU0E3e5ntuDy/PNM0yAsTAGU2waS95sM3sqcoCCOguzcg MKPV50sG0WzrwOXEW/R9u99hP9TzPXSO1qjv+7cFQixK9OkJT1L4sdiygpBEer4nqx1x ovZdzeGuVEOKQG6VQNpw+40dVz3B2W/hh44zyx7jgKMkZyCHxX7ekSuEppqjvNuZS3n7 5nt/zN94bt382L85lBut+mo77M6BJzAwc/XIh8jMnkl37GvyatbBrJprJqgBLSufvPoX tB8A== X-Gm-Message-State: ACrzQf13RYS1hV9rJVbnB8/KO//4iHfVLrXSTThkTDjH+Fq5RM4OnJ8b 3cBLoU6yl6UeTXEqIkj1P7POXgvhZBg= X-Google-Smtp-Source: AMsMyM7ip+nplTHnuGpjoOUQashLTnZ8NQ3V0M58WFKLdqXGNhgKeIcB2PXtBWRwHpGEhUBgsD8AAw== X-Received: by 2002:a17:903:41c9:b0:176:b9df:c743 with SMTP id u9-20020a17090341c900b00176b9dfc743mr10370765ple.162.1663970185974; Fri, 23 Sep 2022 14:56:25 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id z9-20020a1709027e8900b00176be23bbb3sm6440739pla.172.2022.09.23.14.56.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Sep 2022 14:56:25 -0700 (PDT) In-Reply-To: <838rm9q28s.fsf@gnu.org> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=casouri@gmail.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:296097 Archived-At: > On Sep 23, 2022, at 1:12 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Fri, 23 Sep 2022 12:24:45 -0700 >>=20 >>=20 >>=20 >>> On Sep 23, 2022, at 12:20 PM, Yuan Fu wrote: >>>=20 >>> Is there a generic stack data structure that I use in the C core? = Something that automatically grows and shrinks? >>=20 >> *Something that allocates a chunk of memory to store the nodes and = automatically grows and shrinks and copies stuff over. >=20 > 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=E2=80=99ll use that, if not I=E2=80=99ll just use struct stack_node { TSNode node; TSNode *next; }; Yuan=