Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Do not assume size_t == unsigned long



details:   https://anonhg.NetBSD.org/src/rev/d279a04bb340
branches:  trunk
changeset: 445275:d279a04bb340
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Oct 20 14:09:47 2018 +0000

description:
Do not assume size_t == unsigned long

diffstat:

 sys/kern/kern_malloc.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r cee02c5eb5fa -r d279a04bb340 sys/kern/kern_malloc.c
--- a/sys/kern/kern_malloc.c    Sat Oct 20 08:47:03 2018 +0000
+++ b/sys/kern/kern_malloc.c    Sat Oct 20 14:09:47 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_malloc.c,v 1.153 2018/08/22 14:12:30 christos Exp $       */
+/*     $NetBSD: kern_malloc.c,v 1.154 2018/10/20 14:09:47 martin Exp $ */
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_malloc.c,v 1.153 2018/08/22 14:12:30 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_malloc.c,v 1.154 2018/10/20 14:09:47 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -101,12 +101,13 @@
 } __aligned(ALIGNBYTES + 1);
 
 void *
-kern_malloc(unsigned long size, int flags)
+kern_malloc(unsigned long reqsize, int flags)
 {
        const int kmflags = (flags & M_NOWAIT) ? KM_NOSLEEP : KM_SLEEP;
 #ifdef KASAN
-       const size_t origsize = size;
+       const size_t origsize = reqsize;
 #endif
+       size_t size = reqsize;
        size_t allocsize, hdroffset;
        struct malloc_header *mh;
        void *p;



Home | Main Index | Thread Index | Old Index