Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libbsdmalloc libbsdmalloc: Lift C11 divisibility restric...



details:   https://anonhg.NetBSD.org/src/rev/1e333ca7e074
branches:  trunk
changeset: 377277:1e333ca7e074
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 05 10:57:44 2023 +0000

description:
libbsdmalloc: Lift C11 divisibility restriction on aligned_alloc.

Restriction was lifted in C17.

XXX pullup-10

diffstat:

 lib/libbsdmalloc/malloc.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 1442fc23932a -r 1e333ca7e074 lib/libbsdmalloc/malloc.c
--- a/lib/libbsdmalloc/malloc.c Wed Jul 05 10:57:33 2023 +0000
+++ b/lib/libbsdmalloc/malloc.c Wed Jul 05 10:57:44 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: malloc.c,v 1.6 2023/07/05 01:15:47 riastradh Exp $     */
+/*     $NetBSD: malloc.c,v 1.7 2023/07/05 10:57:44 riastradh Exp $     */
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)malloc.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: malloc.c,v 1.6 2023/07/05 01:15:47 riastradh Exp $");
+__RCSID("$NetBSD: malloc.c,v 1.7 2023/07/05 10:57:44 riastradh Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -530,8 +530,7 @@ aligned_alloc(size_t alignment, size_t s
 
        if (alignment == 0 ||
            (alignment & (alignment - 1)) != 0 ||
-           alignment > cachedpagesize() ||
-           (size & (alignment - 1)) != 0) {
+           alignment > cachedpagesize()) {
                errno = EINVAL;
                return NULL;
        }



Home | Main Index | Thread Index | Old Index