emacs-devel
[Top][All Lists]
Advanced

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

String allocation


From: qiang
Subject: String allocation
Date: Sat, 12 Nov 2011 23:01:50 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Thanks to all of you. Reading source code is such an experience for
me, both painful and yet enjoyable. 

Since we are talking about strings, can I ask another obstacle I met. I
know when allocating string objects, emacs will retrieve one from a
string_block struct. My question is how this string_free_list works ?
where does it point to ? How it becomes a list ? Especially I'm puzzled
by this macro

#define NEXT_FREE_LISP_STRING(S) (*(struct Lisp_String **) (S))

I understand S is a pointer to a Lisp_String, how can the following code
construct a free_list ?

for (i = STRING_BLOCK_SIZE - 1; i >= 0; --i)
        {
          s = b->strings + i;
          NEXT_FREE_LISP_STRING (s) = string_free_list;
          string_free_list = s;
        }

Regards
Qiang




reply via email to

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