diff options
| author | Richard M. Stallman | 1997-07-07 19:04:35 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-07-07 19:04:35 +0000 |
| commit | 0a27e8edcbb45dbd4861bc0b532b4446de647b4f (patch) | |
| tree | 25392b2172becd03433c2ab561c7a51de5abd8cd /src/gmalloc.c | |
| parent | ce4200f6793e0d8b03f5b964ac91565dcee920e8 (diff) | |
| download | emacs-0a27e8edcbb45dbd4861bc0b532b4446de647b4f.tar.gz emacs-0a27e8edcbb45dbd4861bc0b532b4446de647b4f.zip | |
Rename macro __P to PP.
Diffstat (limited to 'src/gmalloc.c')
| -rw-r--r-- | src/gmalloc.c | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/src/gmalloc.c b/src/gmalloc.c index ac51e2509fc..4f132391c7a 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c | |||
| @@ -37,13 +37,13 @@ Cambridge, MA 02139, USA. | |||
| 37 | #endif | 37 | #endif |
| 38 | 38 | ||
| 39 | #if defined (__cplusplus) || (defined (__STDC__) && __STDC__) | 39 | #if defined (__cplusplus) || (defined (__STDC__) && __STDC__) |
| 40 | #undef __P | 40 | #undef PP |
| 41 | #define __P(args) args | 41 | #define PP(args) args |
| 42 | #undef __ptr_t | 42 | #undef __ptr_t |
| 43 | #define __ptr_t void * | 43 | #define __ptr_t void * |
| 44 | #else /* Not C++ or ANSI C. */ | 44 | #else /* Not C++ or ANSI C. */ |
| 45 | #undef __P | 45 | #undef PP |
| 46 | #define __P(args) () | 46 | #define PP(args) () |
| 47 | #undef const | 47 | #undef const |
| 48 | #define const | 48 | #define const |
| 49 | #undef __ptr_t | 49 | #undef __ptr_t |
| @@ -96,24 +96,24 @@ extern "C" | |||
| 96 | 96 | ||
| 97 | 97 | ||
| 98 | /* Allocate SIZE bytes of memory. */ | 98 | /* Allocate SIZE bytes of memory. */ |
| 99 | extern __ptr_t malloc __P ((__malloc_size_t __size)); | 99 | extern __ptr_t malloc PP ((__malloc_size_t __size)); |
| 100 | /* Re-allocate the previously allocated block | 100 | /* Re-allocate the previously allocated block |
| 101 | in __ptr_t, making the new block SIZE bytes long. */ | 101 | in __ptr_t, making the new block SIZE bytes long. */ |
| 102 | extern __ptr_t realloc __P ((__ptr_t __ptr, __malloc_size_t __size)); | 102 | extern __ptr_t realloc PP ((__ptr_t __ptr, __malloc_size_t __size)); |
| 103 | /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ | 103 | /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ |
| 104 | extern __ptr_t calloc __P ((__malloc_size_t __nmemb, __malloc_size_t __size)); | 104 | extern __ptr_t calloc PP ((__malloc_size_t __nmemb, __malloc_size_t __size)); |
| 105 | /* Free a block allocated by `malloc', `realloc' or `calloc'. */ | 105 | /* Free a block allocated by `malloc', `realloc' or `calloc'. */ |
| 106 | extern void free __P ((__ptr_t __ptr)); | 106 | extern void free PP ((__ptr_t __ptr)); |
| 107 | 107 | ||
| 108 | /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ | 108 | /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ |
| 109 | #if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */ | 109 | #if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */ |
| 110 | extern __ptr_t memalign __P ((__malloc_size_t __alignment, | 110 | extern __ptr_t memalign PP ((__malloc_size_t __alignment, |
| 111 | __malloc_size_t __size)); | 111 | __malloc_size_t __size)); |
| 112 | #endif | 112 | #endif |
| 113 | 113 | ||
| 114 | /* Allocate SIZE bytes on a page boundary. */ | 114 | /* Allocate SIZE bytes on a page boundary. */ |
| 115 | #if ! (defined (_MALLOC_INTERNAL) && defined (GMALLOC_INHIBIT_VALLOC)) | 115 | #if ! (defined (_MALLOC_INTERNAL) && defined (GMALLOC_INHIBIT_VALLOC)) |
| 116 | extern __ptr_t valloc __P ((__malloc_size_t __size)); | 116 | extern __ptr_t valloc PP ((__malloc_size_t __size)); |
| 117 | #endif | 117 | #endif |
| 118 | 118 | ||
| 119 | 119 | ||
| @@ -213,26 +213,26 @@ extern __malloc_size_t _bytes_free; | |||
| 213 | /* Internal versions of `malloc', `realloc', and `free' | 213 | /* Internal versions of `malloc', `realloc', and `free' |
| 214 | used when these functions need to call each other. | 214 | used when these functions need to call each other. |
| 215 | They are the same but don't call the hooks. */ | 215 | They are the same but don't call the hooks. */ |
| 216 | extern __ptr_t _malloc_internal __P ((__malloc_size_t __size)); | 216 | extern __ptr_t _malloc_internal PP ((__malloc_size_t __size)); |
| 217 | extern __ptr_t _realloc_internal __P ((__ptr_t __ptr, __malloc_size_t __size)); | 217 | extern __ptr_t _realloc_internal PP ((__ptr_t __ptr, __malloc_size_t __size)); |
| 218 | extern void _free_internal __P ((__ptr_t __ptr)); | 218 | extern void _free_internal PP ((__ptr_t __ptr)); |
| 219 | 219 | ||
| 220 | #endif /* _MALLOC_INTERNAL. */ | 220 | #endif /* _MALLOC_INTERNAL. */ |
| 221 | 221 | ||
| 222 | /* Given an address in the middle of a malloc'd object, | 222 | /* Given an address in the middle of a malloc'd object, |
| 223 | return the address of the beginning of the object. */ | 223 | return the address of the beginning of the object. */ |
| 224 | extern __ptr_t malloc_find_object_address __P ((__ptr_t __ptr)); | 224 | extern __ptr_t malloc_find_object_address PP ((__ptr_t __ptr)); |
| 225 | 225 | ||
| 226 | /* Underlying allocation function; successive calls should | 226 | /* Underlying allocation function; successive calls should |
| 227 | return contiguous pieces of memory. */ | 227 | return contiguous pieces of memory. */ |
| 228 | extern __ptr_t (*__morecore) __P ((__malloc_ptrdiff_t __size)); | 228 | extern __ptr_t (*__morecore) PP ((__malloc_ptrdiff_t __size)); |
| 229 | 229 | ||
| 230 | /* Default value of `__morecore'. */ | 230 | /* Default value of `__morecore'. */ |
| 231 | extern __ptr_t __default_morecore __P ((__malloc_ptrdiff_t __size)); | 231 | extern __ptr_t __default_morecore PP ((__malloc_ptrdiff_t __size)); |
| 232 | 232 | ||
| 233 | /* If not NULL, this function is called after each time | 233 | /* If not NULL, this function is called after each time |
| 234 | `__morecore' is called to increase the data size. */ | 234 | `__morecore' is called to increase the data size. */ |
| 235 | extern void (*__after_morecore_hook) __P ((void)); | 235 | extern void (*__after_morecore_hook) PP ((void)); |
| 236 | 236 | ||
| 237 | /* Number of extra blocks to get each time we ask for more core. | 237 | /* Number of extra blocks to get each time we ask for more core. |
| 238 | This reduces the frequency of calling `(*__morecore)'. */ | 238 | This reduces the frequency of calling `(*__morecore)'. */ |
| @@ -241,15 +241,15 @@ extern __malloc_size_t __malloc_extra_blocks; | |||
| 241 | /* Nonzero if `malloc' has been called and done its initialization. */ | 241 | /* Nonzero if `malloc' has been called and done its initialization. */ |
| 242 | extern int __malloc_initialized; | 242 | extern int __malloc_initialized; |
| 243 | /* Function called to initialize malloc data structures. */ | 243 | /* Function called to initialize malloc data structures. */ |
| 244 | extern int __malloc_initialize __P ((void)); | 244 | extern int __malloc_initialize PP ((void)); |
| 245 | 245 | ||
| 246 | /* Hooks for debugging versions. */ | 246 | /* Hooks for debugging versions. */ |
| 247 | extern void (*__malloc_initialize_hook) __P ((void)); | 247 | extern void (*__malloc_initialize_hook) PP ((void)); |
| 248 | extern void (*__free_hook) __P ((__ptr_t __ptr)); | 248 | extern void (*__free_hook) PP ((__ptr_t __ptr)); |
| 249 | extern __ptr_t (*__malloc_hook) __P ((__malloc_size_t __size)); | 249 | extern __ptr_t (*__malloc_hook) PP ((__malloc_size_t __size)); |
| 250 | extern __ptr_t (*__realloc_hook) __P ((__ptr_t __ptr, __malloc_size_t __size)); | 250 | extern __ptr_t (*__realloc_hook) PP ((__ptr_t __ptr, __malloc_size_t __size)); |
| 251 | extern __ptr_t (*__memalign_hook) __P ((__malloc_size_t __size, | 251 | extern __ptr_t (*__memalign_hook) PP ((__malloc_size_t __size, |
| 252 | __malloc_size_t __alignment)); | 252 | __malloc_size_t __alignment)); |
| 253 | 253 | ||
| 254 | /* Return values for `mprobe': these are the kinds of inconsistencies that | 254 | /* Return values for `mprobe': these are the kinds of inconsistencies that |
| 255 | `mcheck' enables detection of. */ | 255 | `mcheck' enables detection of. */ |
| @@ -266,16 +266,16 @@ enum mcheck_status | |||
| 266 | before `malloc' is ever called. ABORTFUNC is called with an error code | 266 | before `malloc' is ever called. ABORTFUNC is called with an error code |
| 267 | (see enum above) when an inconsistency is detected. If ABORTFUNC is | 267 | (see enum above) when an inconsistency is detected. If ABORTFUNC is |
| 268 | null, the standard function prints on stderr and then calls `abort'. */ | 268 | null, the standard function prints on stderr and then calls `abort'. */ |
| 269 | extern int mcheck __P ((void (*__abortfunc) __P ((enum mcheck_status)))); | 269 | extern int mcheck PP ((void (*__abortfunc) PP ((enum mcheck_status)))); |
| 270 | 270 | ||
| 271 | /* Check for aberrations in a particular malloc'd block. You must have | 271 | /* Check for aberrations in a particular malloc'd block. You must have |
| 272 | called `mcheck' already. These are the same checks that `mcheck' does | 272 | called `mcheck' already. These are the same checks that `mcheck' does |
| 273 | when you free or reallocate a block. */ | 273 | when you free or reallocate a block. */ |
| 274 | extern enum mcheck_status mprobe __P ((__ptr_t __ptr)); | 274 | extern enum mcheck_status mprobe PP ((__ptr_t __ptr)); |
| 275 | 275 | ||
| 276 | /* Activate a standard collection of tracing hooks. */ | 276 | /* Activate a standard collection of tracing hooks. */ |
| 277 | extern void mtrace __P ((void)); | 277 | extern void mtrace PP ((void)); |
| 278 | extern void muntrace __P ((void)); | 278 | extern void muntrace PP ((void)); |
| 279 | 279 | ||
| 280 | /* Statistics available to the user. */ | 280 | /* Statistics available to the user. */ |
| 281 | struct mstats | 281 | struct mstats |
| @@ -288,23 +288,23 @@ struct mstats | |||
| 288 | }; | 288 | }; |
| 289 | 289 | ||
| 290 | /* Pick up the current statistics. */ | 290 | /* Pick up the current statistics. */ |
| 291 | extern struct mstats mstats __P ((void)); | 291 | extern struct mstats mstats PP ((void)); |
| 292 | 292 | ||
| 293 | /* Call WARNFUN with a warning message when memory usage is high. */ | 293 | /* Call WARNFUN with a warning message when memory usage is high. */ |
| 294 | extern void memory_warnings __P ((__ptr_t __start, | 294 | extern void memory_warnings PP ((__ptr_t __start, |
| 295 | void (*__warnfun) __P ((const char *)))); | 295 | void (*__warnfun) PP ((const char *)))); |
| 296 | 296 | ||
| 297 | 297 | ||
| 298 | /* Relocating allocator. */ | 298 | /* Relocating allocator. */ |
| 299 | 299 | ||
| 300 | /* Allocate SIZE bytes, and store the address in *HANDLEPTR. */ | 300 | /* Allocate SIZE bytes, and store the address in *HANDLEPTR. */ |
| 301 | extern __ptr_t r_alloc __P ((__ptr_t *__handleptr, __malloc_size_t __size)); | 301 | extern __ptr_t r_alloc PP ((__ptr_t *__handleptr, __malloc_size_t __size)); |
| 302 | 302 | ||
| 303 | /* Free the storage allocated in HANDLEPTR. */ | 303 | /* Free the storage allocated in HANDLEPTR. */ |
| 304 | extern void r_alloc_free __P ((__ptr_t *__handleptr)); | 304 | extern void r_alloc_free PP ((__ptr_t *__handleptr)); |
| 305 | 305 | ||
| 306 | /* Adjust the block at HANDLEPTR to be SIZE bytes long. */ | 306 | /* Adjust the block at HANDLEPTR to be SIZE bytes long. */ |
| 307 | extern __ptr_t r_re_alloc __P ((__ptr_t *__handleptr, __malloc_size_t __size)); | 307 | extern __ptr_t r_re_alloc PP ((__ptr_t *__handleptr, __malloc_size_t __size)); |
| 308 | 308 | ||
| 309 | 309 | ||
| 310 | #ifdef __cplusplus | 310 | #ifdef __cplusplus |
| @@ -341,10 +341,10 @@ Cambridge, MA 02139, USA. | |||
| 341 | #include <errno.h> | 341 | #include <errno.h> |
| 342 | 342 | ||
| 343 | /* How to really get more memory. */ | 343 | /* How to really get more memory. */ |
| 344 | __ptr_t (*__morecore) __P ((ptrdiff_t __size)) = __default_morecore; | 344 | __ptr_t (*__morecore) PP ((ptrdiff_t __size)) = __default_morecore; |
| 345 | 345 | ||
| 346 | /* Debugging hook for `malloc'. */ | 346 | /* Debugging hook for `malloc'. */ |
| 347 | __ptr_t (*__malloc_hook) __P ((__malloc_size_t __size)); | 347 | __ptr_t (*__malloc_hook) PP ((__malloc_size_t __size)); |
| 348 | 348 | ||
| 349 | /* Pointer to the base of the first block. */ | 349 | /* Pointer to the base of the first block. */ |
| 350 | char *_heapbase; | 350 | char *_heapbase; |
| @@ -375,12 +375,12 @@ int __malloc_initialized; | |||
| 375 | 375 | ||
| 376 | __malloc_size_t __malloc_extra_blocks; | 376 | __malloc_size_t __malloc_extra_blocks; |
| 377 | 377 | ||
| 378 | void (*__malloc_initialize_hook) __P ((void)); | 378 | void (*__malloc_initialize_hook) PP ((void)); |
| 379 | void (*__after_morecore_hook) __P ((void)); | 379 | void (*__after_morecore_hook) PP ((void)); |
| 380 | 380 | ||
| 381 | 381 | ||
| 382 | /* Aligned allocation. */ | 382 | /* Aligned allocation. */ |
| 383 | static __ptr_t align __P ((__malloc_size_t)); | 383 | static __ptr_t align PP ((__malloc_size_t)); |
| 384 | static __ptr_t | 384 | static __ptr_t |
| 385 | align (size) | 385 | align (size) |
| 386 | __malloc_size_t size; | 386 | __malloc_size_t size; |
| @@ -408,7 +408,7 @@ align (size) | |||
| 408 | /* Get SIZE bytes, if we can get them starting at END. | 408 | /* Get SIZE bytes, if we can get them starting at END. |
| 409 | Return the address of the space we got. | 409 | Return the address of the space we got. |
| 410 | If we cannot get space at END, fail and return 0. */ | 410 | If we cannot get space at END, fail and return 0. */ |
| 411 | static __ptr_t get_contiguous_space __P ((__malloc_ptrdiff_t, __ptr_t)); | 411 | static __ptr_t get_contiguous_space PP ((__malloc_ptrdiff_t, __ptr_t)); |
| 412 | static __ptr_t | 412 | static __ptr_t |
| 413 | get_contiguous_space (size, position) | 413 | get_contiguous_space (size, position) |
| 414 | __malloc_ptrdiff_t size; | 414 | __malloc_ptrdiff_t size; |
| @@ -442,7 +442,7 @@ get_contiguous_space (size, position) | |||
| 442 | /* This is called when `_heapinfo' and `heapsize' have just | 442 | /* This is called when `_heapinfo' and `heapsize' have just |
| 443 | been set to describe a new info table. Set up the table | 443 | been set to describe a new info table. Set up the table |
| 444 | to describe itself and account for it in the statistics. */ | 444 | to describe itself and account for it in the statistics. */ |
| 445 | static void register_heapinfo __P ((void)); | 445 | static void register_heapinfo PP ((void)); |
| 446 | #ifdef __GNUC__ | 446 | #ifdef __GNUC__ |
| 447 | __inline__ | 447 | __inline__ |
| 448 | #endif | 448 | #endif |
| @@ -497,7 +497,7 @@ static int morecore_recursing; | |||
| 497 | 497 | ||
| 498 | /* Get neatly aligned memory, initializing or | 498 | /* Get neatly aligned memory, initializing or |
| 499 | growing the heap info table as necessary. */ | 499 | growing the heap info table as necessary. */ |
| 500 | static __ptr_t morecore __P ((__malloc_size_t)); | 500 | static __ptr_t morecore PP ((__malloc_size_t)); |
| 501 | static __ptr_t | 501 | static __ptr_t |
| 502 | morecore (size) | 502 | morecore (size) |
| 503 | __malloc_size_t size; | 503 | __malloc_size_t size; |
| @@ -875,14 +875,14 @@ Cambridge, MA 02139, USA. | |||
| 875 | #define __malloc_safe_bcopy safe_bcopy | 875 | #define __malloc_safe_bcopy safe_bcopy |
| 876 | #endif | 876 | #endif |
| 877 | /* This function is defined in realloc.c. */ | 877 | /* This function is defined in realloc.c. */ |
| 878 | extern void __malloc_safe_bcopy __P ((__ptr_t, __ptr_t, __malloc_size_t)); | 878 | extern void __malloc_safe_bcopy PP ((__ptr_t, __ptr_t, __malloc_size_t)); |
| 879 | #define memmove(to, from, size) __malloc_safe_bcopy ((from), (to), (size)) | 879 | #define memmove(to, from, size) __malloc_safe_bcopy ((from), (to), (size)) |
| 880 | #endif | 880 | #endif |
| 881 | #endif | 881 | #endif |
| 882 | 882 | ||
| 883 | 883 | ||
| 884 | /* Debugging hook for free. */ | 884 | /* Debugging hook for free. */ |
| 885 | void (*__free_hook) __P ((__ptr_t __ptr)); | 885 | void (*__free_hook) PP ((__ptr_t __ptr)); |
| 886 | 886 | ||
| 887 | /* List of blocks allocated by memalign. */ | 887 | /* List of blocks allocated by memalign. */ |
| 888 | struct alignlist *_aligned_blocks = NULL; | 888 | struct alignlist *_aligned_blocks = NULL; |
| @@ -1248,7 +1248,7 @@ __malloc_safe_bcopy (afrom, ato, size) | |||
| 1248 | #endif /* emacs */ | 1248 | #endif /* emacs */ |
| 1249 | 1249 | ||
| 1250 | #ifndef memmove | 1250 | #ifndef memmove |
| 1251 | extern void __malloc_safe_bcopy __P ((__ptr_t, __ptr_t, __malloc_size_t)); | 1251 | extern void __malloc_safe_bcopy PP ((__ptr_t, __ptr_t, __malloc_size_t)); |
| 1252 | #define memmove(to, from, size) __malloc_safe_bcopy ((from), (to), (size)) | 1252 | #define memmove(to, from, size) __malloc_safe_bcopy ((from), (to), (size)) |
| 1253 | #endif | 1253 | #endif |
| 1254 | 1254 | ||
| @@ -1258,7 +1258,7 @@ extern void __malloc_safe_bcopy __P ((__ptr_t, __ptr_t, __malloc_size_t)); | |||
| 1258 | #define min(A, B) ((A) < (B) ? (A) : (B)) | 1258 | #define min(A, B) ((A) < (B) ? (A) : (B)) |
| 1259 | 1259 | ||
| 1260 | /* Debugging hook for realloc. */ | 1260 | /* Debugging hook for realloc. */ |
| 1261 | __ptr_t (*__realloc_hook) __P ((__ptr_t __ptr, __malloc_size_t __size)); | 1261 | __ptr_t (*__realloc_hook) PP ((__ptr_t __ptr, __malloc_size_t __size)); |
| 1262 | 1262 | ||
| 1263 | /* Resize the given region to the new size, returning a pointer | 1263 | /* Resize the given region to the new size, returning a pointer |
| 1264 | to the (possibly moved) region. This is optimized for speed; | 1264 | to the (possibly moved) region. This is optimized for speed; |
| @@ -1460,7 +1460,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 1460 | systems with potentially hostile include files. */ | 1460 | systems with potentially hostile include files. */ |
| 1461 | 1461 | ||
| 1462 | #include <stddef.h> | 1462 | #include <stddef.h> |
| 1463 | extern __ptr_t __sbrk __P ((ptrdiff_t increment)); | 1463 | extern __ptr_t __sbrk PP ((ptrdiff_t increment)); |
| 1464 | #endif | 1464 | #endif |
| 1465 | 1465 | ||
| 1466 | #ifndef NULL | 1466 | #ifndef NULL |
| @@ -1508,7 +1508,7 @@ Cambridge, MA 02139, USA. */ | |||
| 1508 | 1508 | ||
| 1509 | #else | 1509 | #else |
| 1510 | 1510 | ||
| 1511 | __ptr_t (*__memalign_hook) __P ((size_t __size, size_t __alignment)); | 1511 | __ptr_t (*__memalign_hook) PP ((size_t __size, size_t __alignment)); |
| 1512 | 1512 | ||
| 1513 | __ptr_t | 1513 | __ptr_t |
| 1514 | memalign (alignment, size) | 1514 | memalign (alignment, size) |
| @@ -1615,7 +1615,7 @@ Cambridge, MA 02139, USA. | |||
| 1615 | #if defined (__GLIBC__) && __GLIBC__ >= 2 | 1615 | #if defined (__GLIBC__) && __GLIBC__ >= 2 |
| 1616 | /* __getpagesize is already declared in <unistd.h> with return type int */ | 1616 | /* __getpagesize is already declared in <unistd.h> with return type int */ |
| 1617 | #else | 1617 | #else |
| 1618 | extern size_t __getpagesize __P ((void)); | 1618 | extern size_t __getpagesize PP ((void)); |
| 1619 | #endif | 1619 | #endif |
| 1620 | #else | 1620 | #else |
| 1621 | #include "getpagesize.h" | 1621 | #include "getpagesize.h" |