unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Quesition about Lisp_Vector
@ 2011-11-11  6:29 Qiang Guo
  2011-11-11  8:59 ` Andreas Schwab
  2011-11-11  9:01 ` Ken Raeburn
  0 siblings, 2 replies; 8+ messages in thread
From: Qiang Guo @ 2011-11-11  6:29 UTC (permalink / raw)
  To: emacs-devel


Hi, I'm new to devel aspect of Emacs. And I'm having a problem reading
Emacs source code: in the definition of Lisp_Vector
 struct Lisp_Vector
  {
    EMACS_UINT size;
    struct Lisp_Vector *next;
    Lisp_Object contents[1];
  };

why contents's size is fixed ? And later when actually allocating space

 nbytes = sizeof *p + (len - 1) * sizeof p->contents[0];

I don't understand how this nbytes is calculated. why only (len-1)
contents[0] ? and how can the size of an array be changed ?

Thanks
Qiang
 




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

end of thread, other threads:[~2011-11-13  1:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-11  6:29 Quesition about Lisp_Vector Qiang Guo
2011-11-11  8:59 ` Andreas Schwab
2011-11-11  9:01 ` Ken Raeburn
2011-11-12  3:42   ` Stephen J. Turnbull
2011-11-12  8:49     ` Eli Zaretskii
2011-11-12 15:45       ` Stephen J. Turnbull
2011-11-12 15:53         ` Eli Zaretskii
2011-11-13  1:02     ` Ken Raeburn

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