[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dragonfly-commits
Subject:    git: kernel - Adjust count algorithm a little
From:       Matthew Dillon <dillon () crater ! dragonflybsd ! org>
Date:       2021-05-18 16:57:06
Message-ID: 20210518165706.CB28011A5DA0 () crater ! dragonflybsd ! org
[Download RAW message or body]


commit ec445c86a5f9ce3efce3a66705271bfe48ccee26
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Tue May 18 09:54:24 2021 -0700

    kernel - Adjust count algorithm a little
    
    * Remove an unnecessary pre-alignment.  The division rounds down and will
      take care of any mis-alignment with regards to calculating the correct
      count value.
    
    * Theoretically due to the fact that the slab is already aligned, and the
      size is already aligned, and the division rounds down, the count
      calculation will be correct.  However we leave te safety code in and make
      it a bit more robust just in case some programmer messes with the code
      later on.
    
    Reported-by: James Cook

Summary of changes:
 sys/kern/kern_kmalloc.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ec445c86a5f9ce3efce3a66705271bfe48ccee26


-- 
DragonFly BSD source repository
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic