about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2022-03-16 12:09:15 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-10-28 11:16:09 +0100
commit68619ddb3b7e8b64a6b849e4972e67163f7659c3 (patch)
tree30368b5713ab1dc9d48f6b04d7e4d9bfe94048f0 /include
parent3fa20d59d9607e4494dfbc99bacee1935ec5ded9 (diff)
downloadglibc-68619ddb3b7e8b64a6b849e4972e67163f7659c3.tar.gz
glibc-68619ddb3b7e8b64a6b849e4972e67163f7659c3.tar.xz
glibc-68619ddb3b7e8b64a6b849e4972e67163f7659c3.zip
malloc: Use uintptr_t in alloc_buffer
The values represnt pointers and not sizes. The members of struct
alloc_buffer are already uintptr_t.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/alloc_buffer.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/alloc_buffer.h b/include/alloc_buffer.h
index be33e8b68c..1c1dbe0a46 100644
--- a/include/alloc_buffer.h
+++ b/include/alloc_buffer.h
@@ -248,9 +248,9 @@ __alloc_buffer_alloc (struct alloc_buffer *buf, size_t size, size_t align)
   if (size == 1 && align == 1)
     return alloc_buffer_alloc_bytes (buf, size);
 
-  size_t current = buf->__alloc_buffer_current;
-  size_t aligned = roundup (current, align);
-  size_t new_current = aligned + size;
+  uintptr_t current = buf->__alloc_buffer_current;
+  uintptr_t aligned = roundup (current, align);
+  uintptr_t new_current = aligned + size;
   if (aligned >= current        /* No overflow in align step.  */
       && new_current >= size    /* No overflow in size computation.  */
       && new_current <= buf->__alloc_buffer_end) /* Room in buffer.  */
@@ -282,8 +282,8 @@ __alloc_buffer_next (struct alloc_buffer *buf, size_t align)
   if (align == 1)
     return (const void *) buf->__alloc_buffer_current;
 
-  size_t current = buf->__alloc_buffer_current;
-  size_t aligned = roundup (current, align);
+  uintptr_t current = buf->__alloc_buffer_current;
+  uintptr_t aligned = roundup (current, align);
   if (aligned >= current        /* No overflow in align step.  */
       && aligned <= buf->__alloc_buffer_end) /* Room in buffer.  */
     {