From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id 4CEC4384F015; Fri, 24 Jun 2022 05:42:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CEC4384F015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Use a precise bit count for the slab free items in UMA. X-Act-Checkin: newlib-cygwin X-Git-Author: Jeff Roberson X-Git-Refname: refs/heads/master X-Git-Oldrev: a13a044c17e1cb5a7e421765c0ee7b1e467458c0 X-Git-Newrev: a6bd733db995ce9269e7654c67d2e57256a8d7c2 Message-Id: <20220624054209.4CEC4384F015@sourceware.org> Date: Fri, 24 Jun 2022 05:42:09 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2022 05:42:09 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Da6bd733db99= 5ce9269e7654c67d2e57256a8d7c2 commit a6bd733db995ce9269e7654c67d2e57256a8d7c2 Author: Jeff Roberson Date: Mon Dec 2 22:44:34 2019 +0000 Use a precise bit count for the slab free items in UMA. =20 This significantly shrinks embedded slab structures. =20 Reviewed by: markj, rlibby (prior version) Differential Revision: https://reviews.freebsd.org/D22584 Diff: --- newlib/libc/sys/rtems/include/sys/bitset.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/newlib/libc/sys/rtems/include/sys/bitset.h b/newlib/libc/sys/r= tems/include/sys/bitset.h index cd70fd4f0..d119c23ca 100644 --- a/newlib/libc/sys/rtems/include/sys/bitset.h +++ b/newlib/libc/sys/rtems/include/sys/bitset.h @@ -249,10 +249,11 @@ #define BITSET_FSET(n) \ [ 0 ... ((n) - 1) ] =3D (-1L) =20 +#define BITSET_SIZE(_s) (__bitset_words((_s)) * sizeof(long)) + /* * Dynamically allocate a bitset. */ -#define BITSET_ALLOC(_s, mt, mf) \ - malloc(__bitset_words(_s) * sizeof(long), mt, (mf)) +#define BITSET_ALLOC(_s, mt, mf) malloc(BITSET_SIZE((_s)), mt, (mf)) =20 #endif /* !_SYS_BITSET_H_ */