From ce94373d770a9aea0a5dc4a7cf14c167ab60874e Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 21 Nov 2018 06:57:05 +0000 Subject: Introducing malloc_usable_size() was a mistake. While some other libs have it, it is a function that is considered harmful, so: Delete malloc_usable_size(). It is a function that blurs the line between malloc managed memory and application managed memory and exposes some of the internal workings of malloc. If an application relies on that, it is likely to break using another implementation of malloc. If you want usable size x, just allocate x bytes. ok deraadt@ and other devs --- include/stdlib.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/stdlib.h b/include/stdlib.h index b0f3dd14782..7a26ed90e4e 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdlib.h,v 1.74 2018/11/18 16:15:18 otto Exp $ */ +/* $OpenBSD: stdlib.h,v 1.75 2018/11/21 06:57:04 otto Exp $ */ /* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */ /*- @@ -112,7 +112,6 @@ long labs(long); ldiv_t ldiv(long, long); void *malloc(size_t); #if __BSD_VISIBLE -size_t malloc_usable_size(void *); void freezero(void *, size_t) __attribute__ ((__bounded__(__buffer__,1,2))); void *reallocarray(void *, size_t, size_t); -- cgit v1.2.3