diff options
| author | otto <> | 2017-04-17 16:36:35 +0000 |
|---|---|---|
| committer | otto <> | 2017-04-17 16:36:35 +0000 |
| commit | 985970d0d19a744c56afb3a8b97a70a371365f31 (patch) | |
| tree | 3653c85a68cb8481deff6f180bacb668913d0f6e | |
| parent | 3c6d814866bd22271bc548c8be2fc1dd2e27f441 (diff) | |
| download | openbsd-985970d0d19a744c56afb3a8b97a70a371365f31.tar.gz openbsd-985970d0d19a744c56afb3a8b97a70a371365f31.tar.bz2 openbsd-985970d0d19a744c56afb3a8b97a70a371365f31.zip | |
whitespace fixes
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/stdlib/malloc.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index ecac7ddfe9..5b92b56eb4 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: malloc.c,v 1.221 2017/04/13 18:32:55 otto Exp $ */ | 1 | /* $OpenBSD: malloc.c,v 1.222 2017/04/17 16:36:35 otto Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net> | 3 | * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net> |
| 4 | * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> | 4 | * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> |
| @@ -261,7 +261,7 @@ hash(void *p) | |||
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | static inline | 263 | static inline |
| 264 | struct dir_info *getpool(void) | 264 | struct dir_info *getpool(void) |
| 265 | { | 265 | { |
| 266 | if (!mopts.malloc_mt) | 266 | if (!mopts.malloc_mt) |
| 267 | return mopts.malloc_pool[0]; | 267 | return mopts.malloc_pool[0]; |
| @@ -1012,7 +1012,7 @@ malloc_bytes(struct dir_info *d, size_t size, void *f) | |||
| 1012 | 1012 | ||
| 1013 | /* Adjust to the real offset of that chunk */ | 1013 | /* Adjust to the real offset of that chunk */ |
| 1014 | k += (lp - bp->bits) * MALLOC_BITS; | 1014 | k += (lp - bp->bits) * MALLOC_BITS; |
| 1015 | 1015 | ||
| 1016 | if (mopts.chunk_canaries) | 1016 | if (mopts.chunk_canaries) |
| 1017 | bp->bits[bp->offset + k] = size; | 1017 | bp->bits[bp->offset + k] = size; |
| 1018 | 1018 | ||
| @@ -1266,7 +1266,7 @@ malloc(size_t size) | |||
| 1266 | } | 1266 | } |
| 1267 | _MALLOC_LOCK(d->mutex); | 1267 | _MALLOC_LOCK(d->mutex); |
| 1268 | d->func = "malloc"; | 1268 | d->func = "malloc"; |
| 1269 | 1269 | ||
| 1270 | if (d->active++) { | 1270 | if (d->active++) { |
| 1271 | malloc_recurse(d); | 1271 | malloc_recurse(d); |
| 1272 | return NULL; | 1272 | return NULL; |
| @@ -1326,7 +1326,7 @@ ofree(struct dir_info *argpool, void *p, int clear, int check, size_t argsz) | |||
| 1326 | if (r != NULL) | 1326 | if (r != NULL) |
| 1327 | break; | 1327 | break; |
| 1328 | } | 1328 | } |
| 1329 | } | 1329 | } |
| 1330 | if (r == NULL) | 1330 | if (r == NULL) |
| 1331 | wrterror(pool, "bogus pointer (double free?) %p", p); | 1331 | wrterror(pool, "bogus pointer (double free?) %p", p); |
| 1332 | } | 1332 | } |
| @@ -1336,9 +1336,9 @@ ofree(struct dir_info *argpool, void *p, int clear, int check, size_t argsz) | |||
| 1336 | if (sz <= MALLOC_MAXCHUNK) { | 1336 | if (sz <= MALLOC_MAXCHUNK) { |
| 1337 | if (mopts.chunk_canaries) { | 1337 | if (mopts.chunk_canaries) { |
| 1338 | struct chunk_info *info = | 1338 | struct chunk_info *info = |
| 1339 | (struct chunk_info *)r->size; | 1339 | (struct chunk_info *)r->size; |
| 1340 | uint32_t chunknum = | 1340 | uint32_t chunknum = |
| 1341 | find_chunknum(pool, r, p, 0); | 1341 | find_chunknum(pool, r, p, 0); |
| 1342 | 1342 | ||
| 1343 | if (info->bits[info->offset + chunknum] < | 1343 | if (info->bits[info->offset + chunknum] < |
| 1344 | argsz) | 1344 | argsz) |
| @@ -1346,7 +1346,7 @@ ofree(struct dir_info *argpool, void *p, int clear, int check, size_t argsz) | |||
| 1346 | " < %zu", | 1346 | " < %zu", |
| 1347 | info->bits[info->offset + chunknum], | 1347 | info->bits[info->offset + chunknum], |
| 1348 | argsz); | 1348 | argsz); |
| 1349 | } | 1349 | } |
| 1350 | } else if (sz - mopts.malloc_guard < argsz) | 1350 | } else if (sz - mopts.malloc_guard < argsz) |
| 1351 | wrterror(pool, "recorded old size %zu < %zu", | 1351 | wrterror(pool, "recorded old size %zu < %zu", |
| 1352 | sz - mopts.malloc_guard, argsz); | 1352 | sz - mopts.malloc_guard, argsz); |
| @@ -1489,7 +1489,7 @@ orealloc(struct dir_info *argpool, void *p, size_t newsz, void *f) | |||
| 1489 | void *q, *ret; | 1489 | void *q, *ret; |
| 1490 | int i; | 1490 | int i; |
| 1491 | uint32_t chunknum; | 1491 | uint32_t chunknum; |
| 1492 | 1492 | ||
| 1493 | pool = argpool; | 1493 | pool = argpool; |
| 1494 | 1494 | ||
| 1495 | if (p == NULL) | 1495 | if (p == NULL) |
| @@ -1510,7 +1510,7 @@ orealloc(struct dir_info *argpool, void *p, size_t newsz, void *f) | |||
| 1510 | if (r != NULL) | 1510 | if (r != NULL) |
| 1511 | break; | 1511 | break; |
| 1512 | } | 1512 | } |
| 1513 | } | 1513 | } |
| 1514 | if (r == NULL) | 1514 | if (r == NULL) |
| 1515 | wrterror(pool, "bogus pointer (double free?) %p", p); | 1515 | wrterror(pool, "bogus pointer (double free?) %p", p); |
| 1516 | } | 1516 | } |
| @@ -1759,7 +1759,7 @@ orecallocarray(struct dir_info *argpool, void *p, size_t oldsize, | |||
| 1759 | int i; | 1759 | int i; |
| 1760 | 1760 | ||
| 1761 | pool = argpool; | 1761 | pool = argpool; |
| 1762 | 1762 | ||
| 1763 | if (p == NULL) | 1763 | if (p == NULL) |
| 1764 | return omalloc(pool, newsize, 1, f); | 1764 | return omalloc(pool, newsize, 1, f); |
| 1765 | 1765 | ||
| @@ -1785,7 +1785,7 @@ orecallocarray(struct dir_info *argpool, void *p, size_t oldsize, | |||
| 1785 | if (r == NULL) | 1785 | if (r == NULL) |
| 1786 | wrterror(pool, "bogus pointer (double free?) %p", p); | 1786 | wrterror(pool, "bogus pointer (double free?) %p", p); |
| 1787 | } | 1787 | } |
| 1788 | 1788 | ||
| 1789 | REALSIZE(sz, r); | 1789 | REALSIZE(sz, r); |
| 1790 | if (sz <= MALLOC_MAXCHUNK) { | 1790 | if (sz <= MALLOC_MAXCHUNK) { |
| 1791 | if (mopts.chunk_canaries) { | 1791 | if (mopts.chunk_canaries) { |
| @@ -1846,7 +1846,7 @@ recallocarray_p(void *ptr, size_t oldnmemb, size_t newnmemb, size_t size) | |||
| 1846 | return NULL; | 1846 | return NULL; |
| 1847 | } | 1847 | } |
| 1848 | oldsize = oldnmemb * size; | 1848 | oldsize = oldnmemb * size; |
| 1849 | 1849 | ||
| 1850 | /* | 1850 | /* |
| 1851 | * Don't bother too much if we're shrinking just a bit, | 1851 | * Don't bother too much if we're shrinking just a bit, |
| 1852 | * we do not shrink for series of small steps, oh well. | 1852 | * we do not shrink for series of small steps, oh well. |
| @@ -1895,7 +1895,7 @@ recallocarray(void *ptr, size_t oldnmemb, size_t newnmemb, size_t size) | |||
| 1895 | 1895 | ||
| 1896 | _MALLOC_LOCK(d->mutex); | 1896 | _MALLOC_LOCK(d->mutex); |
| 1897 | d->func = "recallocarray"; | 1897 | d->func = "recallocarray"; |
| 1898 | 1898 | ||
| 1899 | if ((newnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && | 1899 | if ((newnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && |
| 1900 | newnmemb > 0 && SIZE_MAX / newnmemb < size) { | 1900 | newnmemb > 0 && SIZE_MAX / newnmemb < size) { |
| 1901 | _MALLOC_UNLOCK(d->mutex); | 1901 | _MALLOC_UNLOCK(d->mutex); |
