]> code.delx.au - gnu-emacs/blobdiff - src/ralloc.c
Merge from emacs-24 branch; up to 2012-05-01T10:20:43Z!rgm@gnu.org
[gnu-emacs] / src / ralloc.c
index d736e27952044fcd5446cf2d264fd5b5df1b995c..c40258693f576f9788e0f3d9288aab329862a185 100644 (file)
@@ -396,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);
@@ -741,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)
@@ -1139,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++;
+}
+
 \f
 /***********************************************************************
                            Initialization