From: otto Date: Sat, 27 May 2023 04:33:00 +0000 (+0000) Subject: Remove malloc interposition, a workaround that was once needed for emacs X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d88bac1a87f4e2fb709184b1dc83624df7da8a92;p=openbsd Remove malloc interposition, a workaround that was once needed for emacs ok guenther@ --- diff --git a/lib/libc/hidden/stdlib.h b/lib/libc/hidden/stdlib.h index 46c3536715d..83913245c6c 100644 --- a/lib/libc/hidden/stdlib.h +++ b/lib/libc/hidden/stdlib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdlib.h,v 1.17 2023/05/18 16:11:09 guenther Exp $ */ +/* $OpenBSD: stdlib.h,v 1.18 2023/05/27 04:33:00 otto Exp $ */ /* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */ /*- @@ -57,7 +57,7 @@ PROTO_STD_DEPRECATED(_Exit); PROTO_DEPRECATED(a64l); PROTO_NORMAL(abort); PROTO_NORMAL(abs); -/* PROTO_NORMAL(aligned_alloc) not yet, breaks emacs */ +PROTO_NORMAL(aligned_alloc); PROTO_NORMAL(arc4random); PROTO_NORMAL(arc4random_buf); PROTO_NORMAL(arc4random_uniform); @@ -67,7 +67,7 @@ PROTO_NORMAL(atoi); PROTO_STD_DEPRECATED(atol); PROTO_STD_DEPRECATED(atoll); PROTO_STD_DEPRECATED(bsearch); -/*PROTO_NORMAL(calloc); not yet, breaks emacs */ +PROTO_NORMAL(calloc); PROTO_NORMAL(calloc_conceal); PROTO_NORMAL(cgetcap); PROTO_NORMAL(cgetclose); @@ -88,7 +88,7 @@ PROTO_DEPRECATED(ecvt); PROTO_NORMAL(erand48); PROTO_NORMAL(exit); PROTO_DEPRECATED(fcvt); -/*PROTO_NORMAL(free); not yet, breaks emacs */ +PROTO_NORMAL(free); PROTO_NORMAL(freezero); PROTO_DEPRECATED(gcvt); PROTO_DEPRECATED(getbsize); @@ -108,7 +108,7 @@ PROTO_DEPRECATED(ldiv); PROTO_STD_DEPRECATED(llabs); PROTO_STD_DEPRECATED(lldiv); PROTO_DEPRECATED(lrand48); -/*PROTO_NORMAL(malloc); not yet, breaks emacs */ +PROTO_NORMAL(malloc); PROTO_NORMAL(malloc_conceal); PROTO_STD_DEPRECATED(mblen); PROTO_STD_DEPRECATED(mbstowcs); @@ -122,7 +122,7 @@ PROTO_DEPRECATED(mkstemps); PROTO_DEPRECATED(mktemp); PROTO_DEPRECATED(mrand48); PROTO_DEPRECATED(nrand48); -/*PROTO_NORMAL(posix_memalign); not yet, breaks emacs */ +PROTO_NORMAL(posix_memalign); PROTO_DEPRECATED(posix_openpt); PROTO_DEPRECATED(ptsname); PROTO_NORMAL(putenv); @@ -133,7 +133,7 @@ PROTO_DEPRECATED(radixsort); PROTO_STD_DEPRECATED(rand); PROTO_NORMAL(rand_r); PROTO_DEPRECATED(random); -/*PROTO_NORMAL(realloc); not yet, breaks emacs */ +PROTO_NORMAL(realloc); PROTO_NORMAL(reallocarray); PROTO_NORMAL(recallocarray); PROTO_DEPRECATED(realpath); diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index a6728b2606a..316ae4f484d 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.283 2023/05/10 07:58:06 otto Exp $ */ +/* $OpenBSD: malloc.c,v 1.284 2023/05/27 04:33:00 otto Exp $ */ /* * Copyright (c) 2008, 2010, 2011, 2016, 2023 Otto Moerbeek * Copyright (c) 2012 Matthew Dempsky @@ -1417,7 +1417,7 @@ malloc(size_t size) EPILOGUE() return r; } -/*DEF_STRONG(malloc);*/ +DEF_STRONG(malloc); void * malloc_conceal(size_t size) @@ -1620,7 +1620,7 @@ free(void *ptr) _MALLOC_UNLOCK(d->mutex); errno = saved_errno; } -/*DEF_STRONG(free);*/ +DEF_STRONG(free); static void freezero_p(void *ptr, size_t sz) @@ -1841,7 +1841,7 @@ realloc(void *ptr, size_t size) EPILOGUE() return r; } -/*DEF_STRONG(realloc);*/ +DEF_STRONG(realloc); /* * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX @@ -1872,7 +1872,7 @@ calloc(size_t nmemb, size_t size) EPILOGUE() return r; } -/*DEF_STRONG(calloc);*/ +DEF_STRONG(calloc); void * calloc_conceal(size_t nmemb, size_t size) @@ -2189,7 +2189,7 @@ err: errno = saved_errno; return res; } -/*DEF_STRONG(posix_memalign);*/ +DEF_STRONG(posix_memalign); void * aligned_alloc(size_t alignment, size_t size) @@ -2214,7 +2214,7 @@ aligned_alloc(size_t alignment, size_t size) EPILOGUE() return r; } -/*DEF_STRONG(aligned_alloc);*/ +DEF_STRONG(aligned_alloc); #ifdef MALLOC_STATS