Search
22:17:41
stylewarning
Why doesn't (reconstitute-object (get-lisp-obj-address x)) return x?
22:22:08
Bike
reconstitute-object actually does get-lisp-obj-address itself, at least in my sbcl
22:23:10
stylewarning
hm, I wonder what the deal is then, why it's written that way
22:23:58
phoe
;;; Given the address (untagged, aligned, and interpreted as a FIXNUM)
22:24:00
phoe
;;; of a lisp object, return the object, (...)
22:24:08
phoe
but then it takes the address of the address
22:24:21
phoe
(let* ((object-sap (int-sap (get-lisp-obj-address address))) ...
22:24:27
stylewarning
yeah, i don't understand
22:24:31
phoe
so it takes the address of the fixnum and turns it into a sap
22:25:22
Bike
i don't see anything actually using the function. maybe it just rotted a little.
22:25:36
stylewarning
Bike: MAP-OBJECTS-IN-RANGE uses it
22:26:02
phoe
Bike: `git grep reconstitute-object` returns multiple lines
22:28:06
phoe
and then it takes the header of the sap, meaning that it grabs and understands the fixnum as a header...
22:28:08
pkhuong
phoe: get-lisp-obj-address on a fixnum returns a machine word with the tag bits
22:28:34
pkhuong
it's a trick to avoid consing across function call boundaries
22:29:04
pkhuong
(and the lowtag for fixnums is always 0)
22:30:22
phoe
am I using this correctly? https://plaster.tymoon.eu/view/1556#1556
22:30:34
pkhuong
stylewarning: the inverse of g-l-o-a is make-lisp-obj
22:31:17
phoe
oh, that's why I corrupt the image
22:32:15
pkhuong
phoe: no. you want to clear the tag bits in the tagged address returned by g-l-o-a
22:32:39
pkhuong
then call %make-lisp-obj to turn the machine word into a fixnum
22:32:53
pkhuong
(it'll be a fixnum because the lowtag bits are all 0)
22:39:22
pkhuong
fwiw, all this would be more obvious on a 32 bit build