X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/90207a152538c00b6c75b9774b528470dfb42717..32ac3a6ba32f947a8d6b81ef7609dc69fd6a5d48:/src/ralloc.c diff --git a/src/ralloc.c b/src/ralloc.c index 4bb2f24043..c40258693f 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -31,9 +31,6 @@ along with GNU Emacs. If not, see . */ #include -typedef POINTER_TYPE *POINTER; -typedef size_t SIZE; - #ifdef DOUG_LEA_MALLOC #define M_TOP_PAD -2 extern int mallopt (int, int); @@ -47,9 +44,6 @@ extern size_t __malloc_extra_blocks; #include -typedef size_t SIZE; -typedef void *POINTER; - #include #include @@ -58,6 +52,8 @@ typedef void *POINTER; #include "getpagesize.h" +typedef size_t SIZE; +typedef void *POINTER; #define NIL ((POINTER) 0) /* A flag to indicate whether we have initialized ralloc yet. For @@ -400,7 +396,7 @@ get_bloc (SIZE size) register bloc_ptr new_bloc; register heap_ptr heap; - if (! (new_bloc = (bloc_ptr) malloc (BLOC_PTR_SIZE)) + if (! (new_bloc = malloc (BLOC_PTR_SIZE)) || ! (new_bloc->data = obtain (break_value, size))) { free (new_bloc); @@ -745,7 +741,7 @@ r_alloc_sbrk (long int size) if (! r_alloc_initialized) r_alloc_init (); - if (! use_relocatable_buffers) + if (use_relocatable_buffers <= 0) return (*real_morecore) (size); if (size == 0) @@ -1143,6 +1139,17 @@ r_alloc_reset_variable (POINTER *old, POINTER *new) bloc->variable = new; } +void +r_alloc_inhibit_buffer_relocation (int inhibit) +{ + if (use_relocatable_buffers > 1) + use_relocatable_buffers = 1; + if (inhibit) + use_relocatable_buffers--; + else if (use_relocatable_buffers < 1) + use_relocatable_buffers++; +} + /*********************************************************************** Initialization