unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
To: alin soare <as1789@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: wrong behaviour of <struct frame>
Date: Thu, 02 Dec 2010 10:12:13 +0100	[thread overview]
Message-ID: <4CF762ED.2030104@swipnet.se> (raw)
In-Reply-To: <loom.20101202T094457-764@post.gmane.org>

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	other threads:[~2010-12-02  9:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-02  8:54 wrong behaviour of <struct frame> alin soare
2010-12-02  9:12 ` Jan Djärv [this message]
2010-12-02  9:14   ` Alin Soare
2010-12-02  9:45 ` martin rudalics
2010-12-02 13:14 ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CF762ED.2030104@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=as1789@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).