From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 934623858420 for ; Tue, 15 Mar 2022 21:04:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 934623858420 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 255E3335C92; Tue, 15 Mar 2022 20:36:21 +0000 (UTC) Date: Tue, 15 Mar 2022 16:36:28 -0400 From: Mike Frysinger To: Sebastian Huber Cc: Joel Sherrill , newlib@sourceware.org Subject: Re: [PATCH newlib] libc/include/malloc.h: Add prototype for GNU extension malloc_usable_size() Message-ID: Mail-Followup-To: Sebastian Huber , Joel Sherrill , newlib@sourceware.org References: <20220315151644.369-1-joel@rtems.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XY4rmHWKHNaXJ5x4" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2022 21:04:30 -0000 --XY4rmHWKHNaXJ5x4 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 15 Mar 2022 19:42, Sebastian Huber wrote: > On 15/03/2022 16:47, Mike Frysinger wrote: > > On 15 Mar 2022 10:16, Joel Sherrill wrote: > >> This is not provided by the newlib malloc implementation but may > >> be available in external implementations. > >> --- > >> newlib/libc/include/malloc.h | 4 ++++ > >> 1 file changed, 4 insertions(+) > >> > >> diff --git a/newlib/libc/include/malloc.h b/newlib/libc/include/malloc= =2Eh > >> index a9dc5bca6..e73095e1e 100644 > >> --- a/newlib/libc/include/malloc.h > >> +++ b/newlib/libc/include/malloc.h > >> @@ -137,6 +137,10 @@ extern void __malloc_lock(struct _reent *); > >> =20 > >> extern void __malloc_unlock(struct _reent *); > >> =20 > >> +#if __GNU_VISIBLE > >> +extern size_t malloc_usable_size(void *); > >> +#endif > >> + > > i'm confused. isn't this prototype already defined in this header file > > on line 101 above where you added this ? >=20 > Yes, and it is implemented by the Newlib malloc. while true, we disable malloc in newlib for rtems: newlib/configure.host: # RTEMS supplies its own versions of some routines: # malloc() (reentrant version) #... *-*-rtems*) ... newlib_cflags=3D"${newlib_cflags} ... -DMALLOC_PROVIDED ... so i'm not sure what trouble Joel is running into. maybe rtems also provid= es its own malloc.h and that's what is missing this prototype. -mike --XY4rmHWKHNaXJ5x4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmIw+MwACgkQQWM7n+g3 9YHFthAAnowEjjFe8mYqdOGNsp2MhNKzFNIPUo5Vrpx2Oly/SZeImulm2WlWYIsB RG/pzDg6+MXw06fWSb2L6Y35cYntShKooNj1pmCwm9bhTcHg8HNZ9rWU3G1ipWLj vlqqeMsWAFm1fUzw0DkipmgQ1nIqJphcmgpVapdOnomUiwq5+JPOiWvI42JrHNEX K9figtTVwooX1+2l3fGplvEo3kvRyk7ZY96ANYV9K9txarpkqy9sP45kO3rOhYFg i8gaeevKgsqhYe2QXraaD0OBx9OBAxl38End8B9DWPv7Vxu965uRYJIVrUB/BYlC FeHmn11bDFllJ3EYZkjd4TMOqKlocWMr0iu703kVbVOVEVXK58jv04WnS/sn30SB w/bJj8MqbKwQuCB6yR1ndRr0y40B12yeK3z4mVUH8ChsOsA2aCzSyl/jK29/zAtT YWr2kuAeUCt/c9zBRlygne7mUxC9t/gy6DyTViLhMWH1Jb440nu6IfSb7PRw1eK+ ESQrTyy9+qkEjsaRirqd7jVBD8JDLvZAyIOGsMBHIAAF4Dx212Cbe+wPBmNSIusg C+TUN4gQ78adl7Rmt05tdViEdVoDbdSDbxKhBjcfVxcG9iNtJiHEsWsxj7Zn58KH cI+ov3ULeWOaVOjLIcN9EhqiU+TnzH+bhoMt18/IEwA+lmmM2Fc= =04MS -----END PGP SIGNATURE----- --XY4rmHWKHNaXJ5x4--