emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding extra fields to float_block and cons_block?


From: Stefan Monnier
Subject: Re: Adding extra fields to float_block and cons_block?
Date: Wed, 22 Sep 2021 14:19:31 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]