Variadic C functions now count arguments with size_t, not int.
[bpt/emacs.git] / src / ralloc.c
index 0a2b156..9c601a0 100644 (file)
@@ -1,6 +1,5 @@
 /* Block-relocating memory allocator.
-   Copyright (C) 1993, 1995, 2000, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+   Copyright (C) 1993, 1995, 2000-2011  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -30,9 +29,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "lisp.h"              /* Needed for VALBITS.  */
 #include "blockinput.h"
 
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 
 typedef POINTER_TYPE *POINTER;
 typedef size_t SIZE;
@@ -79,7 +76,7 @@ static void r_alloc_init (void);
 /* Declarations for working with the malloc, ralloc, and system breaks.  */
 
 /* Function to set the real break value.  */
-POINTER (*real_morecore) ();
+POINTER (*real_morecore) (long int);
 
 /* The break value, as seen by malloc.  */
 static POINTER virtual_break_value;
@@ -111,7 +108,7 @@ static int extra_bytes;
    from the system.  */
 
 #ifndef SYSTEM_MALLOC
-extern POINTER (*__morecore) ();
+extern POINTER (*__morecore) (long int);
 #endif
 
 
@@ -519,35 +516,6 @@ relocate_blocs (bloc_ptr bloc, heap_ptr heap, POINTER address)
 
   return 1;
 }
-
-/* Reorder the bloc BLOC to go before bloc BEFORE in the doubly linked list.
-   This is necessary if we put the memory of space of BLOC
-   before that of BEFORE.  */
-
-static void
-reorder_bloc (bloc_ptr bloc, bloc_ptr before)
-{
-  bloc_ptr prev, next;
-
-  /* Splice BLOC out from where it is.  */
-  prev = bloc->prev;
-  next = bloc->next;
-
-  if (prev)
-    prev->next = next;
-  if (next)
-    next->prev = prev;
-
-  /* Splice it in before BEFORE.  */
-  prev = before->prev;
-
-  if (prev)
-    prev->next = bloc;
-  bloc->prev = prev;
-
-  before->prev = bloc;
-  bloc->next = before;
-}
 \f
 /* Update the records of which heaps contain which blocs, starting
    with heap HEAP and bloc BLOC.  */
@@ -680,7 +648,7 @@ resize_bloc (bloc_ptr bloc, SIZE size)
       else
        {
          memmove (bloc->new_data, bloc->data, old_size);
-         memset (bloc->new_data + old_size, 0, size - old_size);
+         memset ((char *) bloc->new_data + old_size, 0, size - old_size);
          *bloc->variable = bloc->data = bloc->new_data;
        }
     }
@@ -1291,6 +1259,3 @@ r_alloc_init (void)
 
   use_relocatable_buffers = 1;
 }
-
-/* arch-tag: 6a524a15-faff-44c8-95d4-a5da6f55110f
-   (do not change this comment) */