unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* About string header
@ 2013-02-28  8:49 Xue Fuqiao
  2013-02-28 13:47 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Xue Fuqiao @ 2013-02-28  8:49 UTC (permalink / raw)
  To: emacs-devel

In (info "(elisp) Garbage Collection"):

 -- Command: garbage-collect
[...]
So an overall result is:
          ((`conses' CONS-SIZE USED-CONSES FREE-CONSES)
           (`symbols' SYMBOL-SIZE USED-SYMBOLS FREE-SYMBOLS)
           (`miscs' MISC-SIZE USED-MISCS FREE-MISCS)
           (`strings' STRING-SIZE USED-STRINGS FREE-STRINGS)
           (`string-bytes' BYTE-SIZE USED-BYTES)
           (`vectors' VECTOR-SIZE USED-VECTORS)
           (`vector-slots' SLOT-SIZE USED-SLOTS FREE-SLOTS)
           (`floats' FLOAT-SIZE USED-FLOATS FREE-FLOATS)
           (`intervals' INTERVAL-SIZE USED-INTERVALS FREE-INTERVALS)
           (`buffers' BUFFER-SIZE USED-BUFFERS)
           (`heap' UNIT-SIZE TOTAL-SIZE FREE-SIZE))
[...]
    STRING-SIZE
          Internal size of a string header, i.e., `sizeof (struct
          Lisp_String)'.

What does the "string header" mean here?  I had searched the manuals and source files in src/ but I didn't find anything useful.

-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: About string header
  2013-02-28  8:49 About string header Xue Fuqiao
@ 2013-02-28 13:47 ` Stefan Monnier
  2013-02-28 14:02   ` Xue Fuqiao
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2013-02-28 13:47 UTC (permalink / raw)
  To: Xue Fuqiao; +Cc: emacs-devel

> What does the "string header" mean here?  I had searched the manuals
> and source files in src/ but I didn't find anything useful.

Every string is made of 2 parts:
The first part is a "Lisp_String" struct of fixed size which holds:
- the size of the string (in bytes and in chars).
- a pointer to the string's text-properties (stored in an "intervals tree").
- a pointer to the second part.
The second part are the actual bytes of the string, which are stored
elsewhere (and can be relocated so as to compact the memory).
The "string header" is the first part.


        Stefan



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: About string header
  2013-02-28 13:47 ` Stefan Monnier
@ 2013-02-28 14:02   ` Xue Fuqiao
  0 siblings, 0 replies; 3+ messages in thread
From: Xue Fuqiao @ 2013-02-28 14:02 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On Thu, 28 Feb 2013 08:47:54 -0500
Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> > What does the "string header" mean here?

> Every string is made of 2 parts:
> The first part is a "Lisp_String" struct of fixed size which holds:
> - the size of the string (in bytes and in chars).
> - a pointer to the string's text-properties (stored in an "intervals tree").
> - a pointer to the second part.
> The second part are the actual bytes of the string, which are stored
> elsewhere (and can be relocated so as to compact the memory).
> The "string header" is the first part.

Thanks for your explanation.  Can this be in the elisp manual?

>         Stefan

-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-28 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-28  8:49 About string header Xue Fuqiao
2013-02-28 13:47 ` Stefan Monnier
2013-02-28 14:02   ` Xue Fuqiao

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).