comparison src/puresize.h @ 13778:7b2f71009e4c

(PURE_P): New macro (three definitions). (CHECK_IMPURE): Use PURE_P.
author Karl Heuer <kwzh@gnu.org>
date Thu, 21 Dec 1995 17:13:56 +0000
parents 180f04639e71
children ee40177f6c68
comparison
equal deleted inserted replaced
13777:5e0cbd5fcb46 13778:7b2f71009e4c
60 /* This is the actual size in bytes to allocate. */ 60 /* This is the actual size in bytes to allocate. */
61 #ifndef PURESIZE 61 #ifndef PURESIZE
62 #define PURESIZE (BASE_PURESIZE * PURESIZE_RATIO) 62 #define PURESIZE (BASE_PURESIZE * PURESIZE_RATIO)
63 #endif 63 #endif
64 64
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. */
71
65 #ifdef VIRT_ADDR_VARIES 72 #ifdef VIRT_ADDR_VARIES
66
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 */
93 100