aboutsummaryrefslogtreecommitdiff
path: root/malloc/malloc-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/malloc-internal.h')
-rw-r--r--malloc/malloc-internal.h20
1 files changed, 0 insertions, 20 deletions
diff --git a/malloc/malloc-internal.h b/malloc/malloc-internal.h
index 9cee0fb2d7..70d5b38504 100644
--- a/malloc/malloc-internal.h
+++ b/malloc/malloc-internal.h
@@ -74,24 +74,4 @@ void __malloc_fork_unlock_child (void) attribute_hidden;
/* Called as part of the thread shutdown sequence. */
void __malloc_arena_thread_freeres (void) attribute_hidden;
-/* Set *RESULT to LEFT * RIGHT. Return true if the multiplication
- overflowed. */
-static inline bool
-check_mul_overflow_size_t (size_t left, size_t right, size_t *result)
-{
-#if __GNUC__ >= 5
- return __builtin_mul_overflow (left, right, result);
-#else
- /* size_t is unsigned so the behavior on overflow is defined. */
- *result = left * right;
- size_t half_size_t = ((size_t) 1) << (8 * sizeof (size_t) / 2);
- if (__glibc_unlikely ((left | right) >= half_size_t))
- {
- if (__glibc_unlikely (right != 0 && *result / right != left))
- return true;
- }
- return false;
-#endif
-}
-
#endif /* _MALLOC_INTERNAL_H */