summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/malloc.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2018-02-07 18:58:31 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2018-02-07 18:58:31 +0000
commite6f74f006d02815d5fadfba2350be4d3f5198b8f (patch)
tree2a7865cfebf1aa96268f9a678678e71b4d75c670 /lib/libc/stdlib/malloc.c
parenta1376251af8400eb790bfd49b18be618ce52cfec (diff)
use consistent style for for loop in unmap(), no functional change
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r--lib/libc/stdlib/malloc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index ebe032a7839..346fa55267f 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.244 2018/01/30 17:46:41 otto Exp $ */
+/* $OpenBSD: malloc.c,v 1.245 2018/02/07 18:58:30 otto Exp $ */
/*
* Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@@ -662,8 +662,7 @@ unmap(struct dir_info *d, void *p, size_t sz, size_t clear, int junk)
mask = mopts.malloc_cache - 1;
if (psz > rsz) {
size_t tounmap = psz - rsz;
- i = 0;
- for (;;) {
+ for (i = 0; ; i++) {
r = &d->free_regions[(i + offset) & mask];
if (r->p != NULL) {
rsz = r->size << MALLOC_PAGESHIFT;
@@ -681,7 +680,6 @@ unmap(struct dir_info *d, void *p, size_t sz, size_t clear, int junk)
break;
}
}
- i++;
}
}
for (i = 0; ; i++) {