diff options
| author | Karl Heuer | 1995-12-21 17:13:56 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-12-21 17:13:56 +0000 |
| commit | f75e1ee572b46f6baf1f0c15aea277cd797efeba (patch) | |
| tree | ca039fc01d0a7b647b2279b8feb0105cf731ae2c | |
| parent | 798b64bbf67df09a69e91f8184974bf7cca3af83 (diff) | |
| download | emacs-f75e1ee572b46f6baf1f0c15aea277cd797efeba.tar.gz emacs-f75e1ee572b46f6baf1f0c15aea277cd797efeba.zip | |
(PURE_P): New macro (three definitions).
(CHECK_IMPURE): Use PURE_P.
| -rw-r--r-- | src/puresize.h | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/puresize.h b/src/puresize.h index b14543146d1..7498c9cda93 100644 --- a/src/puresize.h +++ b/src/puresize.h | |||
| @@ -62,31 +62,38 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 62 | #define PURESIZE (BASE_PURESIZE * PURESIZE_RATIO) | 62 | #define PURESIZE (BASE_PURESIZE * PURESIZE_RATIO) |
| 63 | #endif | 63 | #endif |
| 64 | 64 | ||
| 65 | #ifdef VIRT_ADDR_VARIES | 65 | /* Signal an error if OBJ is pure. */ |
| 66 | #define CHECK_IMPURE(obj) \ | ||
| 67 | { if (PURE_P (obj)) \ | ||
| 68 | pure_write_error (); } | ||
| 69 | |||
| 70 | /* Define PURE_P. */ | ||
| 66 | 71 | ||
| 72 | #ifdef VIRT_ADDR_VARIES | ||
| 67 | /* For machines like APOLLO where text and data can go anywhere | 73 | /* For machines like APOLLO where text and data can go anywhere |
| 68 | in virtual memory. */ | 74 | in virtual memory. */ |
| 69 | #define CHECK_IMPURE(obj) \ | 75 | |
| 70 | { extern EMACS_INT pure[]; \ | 76 | extern EMACS_INT pure[]; |
| 71 | if ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) ((char *) pure + PURESIZE) \ | 77 | |
| 72 | && (PNTR_COMPARISON_TYPE) XPNTR (obj) >= (PNTR_COMPARISON_TYPE) pure) \ | 78 | #define PURE_P(obj) \ |
| 73 | pure_write_error (); } | 79 | ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) ((char *) pure + PURESIZE) \ |
| 80 | && (PNTR_COMPARISON_TYPE) XPNTR (obj) >= (PNTR_COMPARISON_TYPE) pure) | ||
| 74 | 81 | ||
| 75 | #else /* not VIRT_ADDR_VARIES */ | 82 | #else /* not VIRT_ADDR_VARIES */ |
| 76 | #ifdef PNTR_COMPARISON_TYPE | 83 | #ifdef PNTR_COMPARISON_TYPE |
| 84 | /* When PNTR_COMPARISON_TYPE is not the default (unsigned int). */ | ||
| 77 | 85 | ||
| 78 | /* when PNTR_COMPARISON_TYPE is not the default (unsigned int) */ | 86 | extern char my_edata[]; |
| 79 | #define CHECK_IMPURE(obj) \ | 87 | |
| 80 | { extern char my_edata[]; \ | 88 | #define PURE_P(obj) \ |
| 81 | if ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) my_edata) \ | 89 | ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) my_edata) |
| 82 | pure_write_error (); } | ||
| 83 | 90 | ||
| 84 | #else /* not VIRT_ADDRESS_VARIES, not PNTR_COMPARISON_TYPE */ | 91 | #else /* not VIRT_ADDRESS_VARIES, not PNTR_COMPARISON_TYPE */ |
| 85 | 92 | ||
| 86 | #define CHECK_IMPURE(obj) \ | 93 | extern char my_edata[]; |
| 87 | { extern char my_edata[]; \ | 94 | |
| 88 | if (XPNTR (obj) < (unsigned int) my_edata) \ | 95 | #define PURE_P(obj) \ |
| 89 | pure_write_error (); } | 96 | (XPNTR (obj) < (unsigned int) my_edata) |
| 90 | 97 | ||
| 91 | #endif /* PNTR_COMPARISON_TYPE */ | 98 | #endif /* PNTR_COMPARISON_TYPE */ |
| 92 | #endif /* VIRT_ADDRESS_VARIES */ | 99 | #endif /* VIRT_ADDRESS_VARIES */ |