From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: schwab@linux-m68k.org, emacs-devel@gnu.org
Subject: Re: VIRT_ADDR_VARIES
Date: Thu, 10 Nov 2011 06:06:28 -0500 [thread overview]
Message-ID: <E1ROSSi-0003lj-V4@fencepost.gnu.org> (raw)
In-Reply-To: <4EBB8882.6080504@cs.ucla.edu> (message from Paul Eggert on Thu, 10 Nov 2011 00:17:06 -0800)
> Date: Thu, 10 Nov 2011 00:17:06 -0800
> From: Paul Eggert <eggert@cs.ucla.edu>
> Cc: emacs-devel@gnu.org
>
> --- src/puresize.h 2011-06-09 19:08:29 +0000
> +++ src/puresize.h 2011-11-10 08:14:27 +0000
> @@ -75,21 +75,7 @@
> \f
> /* Define PURE_P. */
>
> -#ifdef VIRT_ADDR_VARIES
> -/* For machines where text and data can go anywhere
> - in virtual memory. */
> -
> extern EMACS_INT pure[];
>
> #define PURE_P(obj) \
> - ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) ((char *) pure + PURESIZE) \
> - && (PNTR_COMPARISON_TYPE) XPNTR (obj) >= (PNTR_COMPARISON_TYPE) pure)
> -
> -#else /* not VIRT_ADDR_VARIES */
> -
> -extern char my_edata[];
> -
> -#define PURE_P(obj) \
> - ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) my_edata)
> -
> -#endif /* VIRT_ADDRESS_VARIES */
> + ((uintptr_t) XPNTR (obj) - (uintptr_t) pure <= PURESIZE)
What is the exact definition of "a pure object"? Your changes assume
that it is something allocated off pure[], but the original macro,
viz.
extern char my_edata[];
#define PURE_P(obj) \
((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) my_edata)
tests something different. It could, for example, return non-zero for
an object that was not dynamically allocated at all. It could be that
a test against my_edata was just a means, but we should be sure it
was, before we effectively define VIRT_ADDRESS_VARIES on all
platforms.
Also, isn't it dangerous to have an externally visible symbol with a
name such as `pure'? What if some system library somewhere also has
such a symbol?
next prev parent reply other threads:[~2011-11-10 11:06 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-06 17:18 VIRT_ADDR_VARIES Andreas Schwab
2011-11-07 1:50 ` VIRT_ADDR_VARIES Paul Eggert
2011-11-07 8:38 ` VIRT_ADDR_VARIES Andreas Schwab
2011-11-07 23:23 ` VIRT_ADDR_VARIES Paul Eggert
2011-11-08 8:56 ` VIRT_ADDR_VARIES Andreas Schwab
2011-11-08 17:34 ` VIRT_ADDR_VARIES Paul Eggert
2011-11-08 18:38 ` VIRT_ADDR_VARIES Andreas Schwab
2011-11-08 21:17 ` VIRT_ADDR_VARIES Paul Eggert
2011-11-08 22:06 ` VIRT_ADDR_VARIES Andreas Schwab
2011-11-09 17:44 ` VIRT_ADDR_VARIES Paul Eggert
2011-11-09 21:32 ` VIRT_ADDR_VARIES Andreas Schwab
2011-11-10 8:17 ` VIRT_ADDR_VARIES Paul Eggert
2011-11-10 9:29 ` VIRT_ADDR_VARIES Andreas Schwab
2011-11-10 16:19 ` VIRT_ADDR_VARIES Paul Eggert
2011-11-10 11:06 ` Eli Zaretskii [this message]
2011-11-10 11:20 ` VIRT_ADDR_VARIES Andreas Schwab
2011-11-10 16:29 ` VIRT_ADDR_VARIES Paul Eggert
2011-11-10 16:43 ` VIRT_ADDR_VARIES Eli Zaretskii
2011-11-10 16:50 ` VIRT_ADDR_VARIES Paul Eggert
2011-11-10 18:06 ` VIRT_ADDR_VARIES Eli Zaretskii
2011-11-14 4:57 ` VIRT_ADDR_VARIES Paul Eggert
2011-11-10 4:05 ` VIRT_ADDR_VARIES Stephen J. Turnbull
2011-11-10 5:40 ` VIRT_ADDR_VARIES Paul Eggert
2011-11-10 17:05 ` VIRT_ADDR_VARIES Andreas Schwab
2011-11-10 17:15 ` VIRT_ADDR_VARIES Paul Eggert
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1ROSSi-0003lj-V4@fencepost.gnu.org \
--to=eliz@gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=schwab@linux-m68k.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.