emacs-devel
[Top][All Lists]
Advanced

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

Re: wrong behaviour of <struct frame>


From: Jan Djärv
Subject: Re: wrong behaviour of <struct frame>
Date: Thu, 02 Dec 2010 10:12:13 +0100
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

Read the comments:

  /* All Lisp_Object components must come first.
     That ensures they are all aligned normally.  */

and

  /* Beyond here, there should be no more Lisp_Object components.  */

Also see allocate_frame in alloc.c and make_frame in frame.c.

        Jan D.


alin soare skrev 2010-12-02 09.54:
I defined within the struct frame an integer variable

int ct;

If I define it immediately after the menu_bar_vector, it is initialized
somewhere with the pointer value of Qnil. (&Qnil)

       Only the X toolkit version uses this.  */

    Lisp_Object menu_bar_vector;
+
+    int ct;


In this case, if I change the value f->ct, emacs crashes with segmentation
fault, generated by the garbage collector. Why , as time as I initialize a
variable defined by myself ?


-----------------------------------------

If I define it at the end of struct frame, id est immediately after the
fieldforeground_pixel,

/* All display backends seem to need these two pixel values. */
   unsigned long background_pixel;
   unsigned long foreground_pixel;
+
+    int ct;
}

everything works fine in that case.

I wish to ask you to suggest me if you can, what happens when I define the var.
'ct' inside the struct frame.



Alin.






reply via email to

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