This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Remove __malloc_ptrdiff_t

On 03/07/2013 11:42 PM, Joseph S. Myers wrote:
This patch, relative to a tree with
<> (pending
review) applied, removes the __malloc_ptrdiff_t macro, which is no
longer a useful abstraction, replacing its single use by a direct use
of ptrdiff_t.  Tested x86_64.

2013-03-07 Joseph Myers <>

	* malloc/malloc.h (__malloc_ptrdiff_t): Remove macro.
	* malloc/morecore.c (__default_morecore): Use ptrdiff_t instead of

diff --git a/malloc/malloc.h b/malloc/malloc.h
index 4695b7d..cd691f1 100644
--- a/malloc/malloc.h
+++ b/malloc/malloc.h
@@ -24,9 +24,6 @@
  #include <stdio.h>
  # define __malloc_ptr_t  void *

-/* Used by GNU libc internals. */
-#define __malloc_ptrdiff_t ptrdiff_t
  #ifdef _LIBC
diff --git a/malloc/morecore.c b/malloc/morecore.c
index 3b19406..57284e0 100644
--- a/malloc/morecore.c
+++ b/malloc/morecore.c
@@ -43,7 +43,7 @@ libc_hidden_proto (__sbrk)
     If INCREMENT is negative, shrink data space.  */
  __default_morecore (increment)
-     __malloc_ptrdiff_t increment;
+     ptrdiff_t increment;

While you're at it, could you use an ISO C prototype here, please?

Ok with that change,


    __malloc_ptr_t result = (__malloc_ptr_t) __sbrk (increment);
    if (result == (__malloc_ptr_t) -1)

 Andreas Jaeger aj@{,} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]