From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1184 invoked from network); 17 Aug 2020 21:30:47 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 17 Aug 2020 21:30:47 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 635C29E1B8; Tue, 18 Aug 2020 07:30:40 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 7524E9CAB3; Tue, 18 Aug 2020 07:29:56 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=majumdar-org-uk.20150623.gappssmtp.com header.i=@majumdar-org-uk.20150623.gappssmtp.com header.b="Hbn+aUWi"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 7D5D49CAB3; Tue, 18 Aug 2020 07:29:53 +1000 (AEST) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by minnie.tuhs.org (Postfix) with ESMTPS id D6F129C8BB for ; Tue, 18 Aug 2020 07:29:51 +1000 (AEST) Received: by mail-lj1-f173.google.com with SMTP id v4so19151099ljd.0 for ; Mon, 17 Aug 2020 14:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=majumdar-org-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JRLwlpi4B631rFBVF1iPQQxijFdz0axcHRJW8ZL4kaw=; b=Hbn+aUWiiBZNXvssZ1wzkQFl8PXrlX+gCHBmlwQOUXQdN6w6jDELHEpZaZrpLUijiJ MpfYCvC69uOadnLtEqoo/ebqWeTCJXm/F87unDo7igift9MhFr7JugHap+cqfoJCaIr3 gonwmLMUr42kXjHC35xMzc8jqbEbulyVgresbdHUKfoL/gWw9xN82EKAGmZDet1/6RCi vhjK1Wpt04xCZ4K1d8/gl3fMq8/7S1DFHl3eP4/g7rUHZUoLjsWrBoOJ1fYX5ycIDpJD gY1qwUjHn67U1A/36b4LiHc3uyvnK8ft7TUbwWodIKUUOWSpTj3k9rl4/ZKwzqn3j+QR WRzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JRLwlpi4B631rFBVF1iPQQxijFdz0axcHRJW8ZL4kaw=; b=aTFvlxad2q9QRlfJeemL+0ZkV8R+redy5zt/FsI2PNPcrgGPMVr4ixqxRy7RgHl/XS sJO5LhTB/n4BAKw/U81xCbklh5/o4qXXNCiRgH8mlayZkq2UtBJ4+IDaUJQGKl3ueZRc j04bJfLJQMkJqA48BR4pS3MksqREdZDTQSs2W7OtdUrDCYtz4B49mgNtWhGIKbx20MVD 6Cek5wNCd6gAggYX0V74ijogCl6dYdbnZQEf2wfIP+d5WZWnZJQI0DgeLn1+4EEG8N+N RamE3XdtENhXYF8zRb2/rifUlfuZNEtQFsN/JmKq5j3k3YZNLDo9SNKQAMa2be6Gy1Al 7dSA== X-Gm-Message-State: AOAM532JKO/VB8QSdE2dNGje6r4TNG8B3liypafQWtbN5PSQhndN/IOj TyQGT3FtlPmCzxR+Pbnf5T31JHU/wNqeEy/vyhVR/w== X-Google-Smtp-Source: ABdhPJz5jQ5jjGbl6BgpWvPJglXgEfTBgH6zyTigoDfQRllRTb3oUkm4THXV7cnAM17Hl6xvWj5Jf0R85AqcTsm28Ok= X-Received: by 2002:a2e:8957:: with SMTP id b23mr7801854ljk.331.1597699790179; Mon, 17 Aug 2020 14:29:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dibyendu Majumdar Date: Mon, 17 Aug 2020 22:29:38 +0100 Message-ID: To: Dan Cross Content-Type: text/plain; charset="UTF-8" Subject: Re: [TUHS] Memory management in Dennis Ritchie's C Compiler X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The TUHS Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" On Mon, 17 Aug 2020 at 21:16, Dibyendu Majumdar wrote: > Memory can be used for declarations, trees (for expressions) and > strings as far as I can tell. Strings actually use the tree > allocation, and just pretend that a node is a string. > It seems that tree memory is allocated in a stack discipline. But what > puzzled me is that when a tree starts, about 512 bytes of memory are > left as gap for declarations to use. I have been trying to think in > what circumstances would you encounter a declaration while parsing an > expression - perhaps cast expressions? Anyway - if a declaration > occurs inside an expression (i.e. tree) then it only has 512 bytes > available. Of course this could be made bigger ... but at the least I > would like to have separate heaps for declarations, trees and strings. > Okay it seems those are undefined symbols encountered in an expression. Symbols use the same allocation function as declarations. Regards Dibyendu