projects
/
dragonfly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
e0fe4b4
)
kmalloc: Streamline the code a little bit
author
Sepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 10 Oct 2012 12:49:59 +0000 (20:49 +0800)
committer
Sepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 10 Oct 2012 12:49:59 +0000 (20:49 +0800)
sys/kern/kern_slaballoc.c
patch
|
blob
|
blame
|
history
diff --git
a/sys/kern/kern_slaballoc.c
b/sys/kern/kern_slaballoc.c
index
3fc43d7
..
237365e
100644
(file)
--- a/
sys/kern/kern_slaballoc.c
+++ b/
sys/kern/kern_slaballoc.c
@@
-829,9
+829,9
@@
kmalloc(unsigned long size, struct malloc_type *type, int flags)
* Otherwise properly align the data according to the chunk size.
*/
if (powerof2(size))
- off = (off + size - 1) & ~(size - 1);
- else
- off = (off + align - 1) & ~(align - 1);
+ align = size;
+ off = (off + align - 1) & ~(align - 1);
+
z->z_Magic = ZALLOC_SLAB_MAGIC;
z->z_ZoneIndex = zi;
z->z_NMax = (ZoneSize - off) / size;