From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Adding extra fields to float_block and cons_block? Date: Wed, 22 Sep 2021 14:19:31 -0400 Message-ID: References: <875yuszs7h.fsf.ref@yahoo.com> <875yuszs7h.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25516"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 22 20:53:43 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 1mT7NH-0006Oe-81 for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Sep 2021 20:53:43 +0200 Original-Received: from localhost ([::1]:51256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mT7NE-0006pZ-KL for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Sep 2021 14:53:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mT6qJ-0003Bd-5p for emacs-devel@gnu.org; Wed, 22 Sep 2021 14:19:39 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mT6qG-0006w1-I8 for emacs-devel@gnu.org; Wed, 22 Sep 2021 14:19:38 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4890B4413B4; Wed, 22 Sep 2021 14:19:35 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E81494413B0; Wed, 22 Sep 2021 14:19:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1632334773; bh=tdLY0kntnomAXb3ksqTdOt1KX/aI9rQ9VhcRTy1yO98=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=QPxtVXeGB7P2t8jZXH2onN570wyFnJSJIjej4Sg8z1EzZMzx0pqbicRzaRYOYPZ0p wOisZ15VRAaQPnbDkT2ZRqgv0MvZaXKOdZKCAGrziWD+ESb6EEArKtqSAEizKo2h8N R/9zzL76+0IQKO6U7a41CWUNvhkUAloMiYtj0AvOGhYFuJagYmtMTlKw0tFPnoKqJm 1ZkjQEclCrx9BlVvx4quvCv407NdAZS83Nco/WAR53ZNdlwSKJCSQXPlsGhyQ9nY7v SGhIMtIzWlLrBSYpA1zbGR/6w2KhCRVwucUb/zv2Lh9czjf3qVvWSajUWLqVhQ7QIf HAiloJFp5UJFA== Original-Received: from pastel (unknown [45.72.241.23]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BC4B8120329; Wed, 22 Sep 2021 14:19:33 -0400 (EDT) In-Reply-To: <875yuszs7h.fsf@yahoo.com> (Po Lu's message of "Wed, 22 Sep 2021 20:54:10 +0800") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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.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:275331 Archived-At: Po Lu [2021-09-22 20:54:10] wrote: > I tried adding an extra array of bits_words to cons_block and > float_block, in alloc.c, defined as follows: [...] > I can't seem to figure out the hairy mess surrounding that code, and I'd > appreciate it if someone could explain the proper procedure for adding > extra fields to those two structs. Thanks. These blocks are used to store the 129bits we need per cons cells (2x64bit for the car and cdr plus 1bit for the markbit). So the block themselves need to be aligned on a multiple of 1KB (IIRC), the cons cells are aligned on a multiple of 8B (so they each store 128bit only) and the extra bit can be found by taking the cons's address, truncating the last few bits to find the address of the block and then looking up the bit in the corresponding bitvector. How to modify it will likely depend on what info you need/want to add in there. So what is this extra array of bits_words you want to add? Do you want to grow cons cells to 130bits, basically? Stefan