* What does "tag space" mean? @ 2013-03-01 12:39 Xue Fuqiao 2013-03-01 13:21 ` Aurélien Aptel 2013-03-01 14:40 ` Thien-Thi Nguyen 0 siblings, 2 replies; 5+ messages in thread From: Xue Fuqiao @ 2013-03-01 12:39 UTC (permalink / raw) To: help-gnu-emacs In (info "(elisp) Object Internals"): Since the tag space is limited, all other types are the subtypes of either `Lisp_Vectorlike' or `Lisp_Misc'. What does "tag space" mean here? I had searched the manual and web, but I didn't find anything useful. Can anybody help? Thanks. -- Best regards, Xue Fuqiao. http://www.emacswiki.org/emacs/XueFuqiao ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What does "tag space" mean? 2013-03-01 12:39 What does "tag space" mean? Xue Fuqiao @ 2013-03-01 13:21 ` Aurélien Aptel 2013-03-01 13:39 ` Xue Fuqiao 2013-03-01 14:19 ` Eli Zaretskii 2013-03-01 14:40 ` Thien-Thi Nguyen 1 sibling, 2 replies; 5+ messages in thread From: Aurélien Aptel @ 2013-03-01 13:21 UTC (permalink / raw) To: Xue Fuqiao; +Cc: help-gnu-emacs On Fri, Mar 1, 2013 at 1:39 PM, Xue Fuqiao <xfq.free@gmail.com> wrote: > What does "tag space" mean here? I had searched the manual and web, but I > didn't find anything useful. Can anybody help? Thanks. Lisp_Objet use 3 bits to store types ie. to "tag" a pointer. Thus, tag space can hold 2^3 values. I've started to write a small guide to the C code on emacswiki [1]. Any contribution welcome :) http://www.emacswiki.org/emacs/HackerGuide ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What does "tag space" mean? 2013-03-01 13:21 ` Aurélien Aptel @ 2013-03-01 13:39 ` Xue Fuqiao 2013-03-01 14:19 ` Eli Zaretskii 1 sibling, 0 replies; 5+ messages in thread From: Xue Fuqiao @ 2013-03-01 13:39 UTC (permalink / raw) To: Aurélien Aptel; +Cc: help-gnu-emacs On Fri, 1 Mar 2013 14:21:45 +0100 Aurélien Aptel <aurelien.aptel+emacs@gmail.com> wrote: > On Fri, Mar 1, 2013 at 1:39 PM, Xue Fuqiao <xfq.free@gmail.com> wrote: > > What does "tag space" mean here? > Lisp_Object use 3 bits to store types ie. to "tag" a pointer. Thus, tag > space can hold 2^3 values. Ah, I see, thanks. > I've started to write a small guide to the C code on emacswiki [1]. > Any contribution welcome :) > > http://www.emacswiki.org/emacs/HackerGuide Looks great. I'm not familiar with C code in Emacs, and I'm wondering how to read the source these days. Thanks for your help. -- Best regards, Xue Fuqiao. http://www.emacswiki.org/emacs/XueFuqiao ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What does "tag space" mean? 2013-03-01 13:21 ` Aurélien Aptel 2013-03-01 13:39 ` Xue Fuqiao @ 2013-03-01 14:19 ` Eli Zaretskii 1 sibling, 0 replies; 5+ messages in thread From: Eli Zaretskii @ 2013-03-01 14:19 UTC (permalink / raw) To: help-gnu-emacs > Date: Fri, 1 Mar 2013 14:21:45 +0100 > From: Aurélien Aptel <aurelien.aptel+emacs@gmail.com> > Cc: help-gnu-emacs@gnu.org > > I've started to write a small guide to the C code on emacswiki [1]. > Any contribution welcome :) Comments: . Unless you intend to cover non-Posix platforms, I suggest to remove from the "Build configuration" everything that is not applicable to Posix systems, like config.bat. . I suggest to show the relevant pieces of C code when you describe something like Lisp_Object or XVECTORP. I think it will make the document much more self-contained, as anyone who reads it will need to consult the C code anyway. . Don't point to specific source line numbers, they change very frequently as part of development. "Around line NNNN" is much better, and sometimes it is better to omit that entirely. . The part about 256MB limitation of buffers on 32-bit systems is incorrect: the max size is 512MB. Your bit calculations are in error. See VAL_MAX. . I question the usefulness of listing all of the Xfoo macros. It should be enough to explain that Xfoo(x) returns a C object corresponding to a Lisp object of type foo. Same goes for the fooP macros. The document doesn't yet go too far to become interesting, so the above are just small nits. Thanks. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What does "tag space" mean? 2013-03-01 12:39 What does "tag space" mean? Xue Fuqiao 2013-03-01 13:21 ` Aurélien Aptel @ 2013-03-01 14:40 ` Thien-Thi Nguyen 1 sibling, 0 replies; 5+ messages in thread From: Thien-Thi Nguyen @ 2013-03-01 14:40 UTC (permalink / raw) To: Xue Fuqiao; +Cc: help-gnu-emacs [-- Attachment #1: Type: text/plain, Size: 1916 bytes --] () Xue Fuqiao <xfq.free@gmail.com> () Fri, 1 Mar 2013 20:39:52 +0800 What does "tag space" mean here? Personally, i think of "space" as the contents of an empty container, which is similar to the "set of possible elements of a container" (more classical meaning), which is similar to "sets with some added structure" (<https://en.wikipedia.org/wiki/Space>). Leave it to the mathematicians to drive straight into the fog. :-D Here, the container is a bit field, and a "tag" is a particular pattern in that bit field. If all bits are orthogonal, the space for an N-bit field numbers 2^N. So that's where the "structure" comes in; In some tag systems, all bits are "equal" (either 1 or 0), but some bits are "more equal than others". This usually manifests as "if bit A is 1, then the value of bit B doesn't matter (don't care)". Such a structure reduces the space: - orthogonal -- count: 4 A B 0 0 0 1 1 0 1 1 - non-orthogonal -- count: 3 A B 0 0 0 1 1 X The tags stand for "types" and so when there is no more "space" in the primary "space", one has to resort to "sub-types", represented by way of a secondary (additional) bit field, w/ its own structure (perhaps). Now, if the primary and secondary bit fields abut, you might think of them to be simply THE bit field (w/o distinction, but definitely WITH structure). That's a matter of taste. (If they do not abut, well then, there is no choice, unless you squint a little and elide the invervening bits. Personally, i imagine it like a diamond-back snake slithering past, each diamond on its back adjacent to another, even when looped...) Oops, sorry about that. It's very easy for me to "space out" on this topic. See src/lisp.h, starting w/ comment "Select the tagging scheme", for details. -- Thien-Thi Nguyen GPG key: 4C807502 [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-01 14:40 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-03-01 12:39 What does "tag space" mean? Xue Fuqiao 2013-03-01 13:21 ` Aurélien Aptel 2013-03-01 13:39 ` Xue Fuqiao 2013-03-01 14:19 ` Eli Zaretskii 2013-03-01 14:40 ` Thien-Thi Nguyen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).