summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortedu <>2015-01-05 21:04:04 +0000
committertedu <>2015-01-05 21:04:04 +0000
commita6e31cd9243757b5df0b259fe6a94f654b53fcc4 (patch)
tree7f4e101aa931085a44e5292df23ea8b51d6fef10
parentcf4c3bf9a31e2805b0a7745849b47412d148cd03 (diff)
downloadopenbsd-a6e31cd9243757b5df0b259fe6a94f654b53fcc4.tar.gz
openbsd-a6e31cd9243757b5df0b259fe6a94f654b53fcc4.tar.bz2
openbsd-a6e31cd9243757b5df0b259fe6a94f654b53fcc4.zip
rename kern enter/exit macros to malloc enter/leave to better reflect
what's going on.
-rw-r--r--src/lib/libc/stdlib/malloc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c
index 165ad70031..57d35b80b6 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.171 2014/08/18 14:34:58 tedu Exp $ */ 1/* $OpenBSD: malloc.c,v 1.172 2015/01/05 21:04:04 tedu Exp $ */
2/* 2/*
3 * Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net> 3 * Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net>
4 * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> 4 * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@@ -93,11 +93,11 @@
93#define MQUERY(a, sz) mquery((a), (size_t)(sz), PROT_READ | PROT_WRITE, \ 93#define MQUERY(a, sz) mquery((a), (size_t)(sz), PROT_READ | PROT_WRITE, \
94 MAP_ANON | MAP_PRIVATE | MAP_FIXED, -1, (off_t)0) 94 MAP_ANON | MAP_PRIVATE | MAP_FIXED, -1, (off_t)0)
95 95
96#define KERNENTER() if (__isthreaded) do { \ 96#define _MALLOC_LEAVE() if (__isthreaded) do { \
97 malloc_active--; \ 97 malloc_active--; \
98 _MALLOC_UNLOCK(); \ 98 _MALLOC_UNLOCK(); \
99} while (0) 99} while (0)
100#define KERNEXIT() if (__isthreaded) do { \ 100#define _MALLOC_ENTER() if (__isthreaded) do { \
101 _MALLOC_LOCK(); \ 101 _MALLOC_LOCK(); \
102 malloc_active++; \ 102 malloc_active++; \
103} while (0) 103} while (0)
@@ -406,9 +406,9 @@ map(struct dir_info *d, size_t sz, int zero_fill)
406 return MAP_FAILED; 406 return MAP_FAILED;
407 } 407 }
408 if (psz > d->free_regions_size) { 408 if (psz > d->free_regions_size) {
409 KERNENTER(); 409 _MALLOC_LEAVE();
410 p = MMAP(sz); 410 p = MMAP(sz);
411 KERNEXIT(); 411 _MALLOC_ENTER();
412 if (p != MAP_FAILED) 412 if (p != MAP_FAILED)
413 STATS_ADD(d->malloc_used, sz); 413 STATS_ADD(d->malloc_used, sz);
414 /* zero fill not needed */ 414 /* zero fill not needed */
@@ -454,9 +454,9 @@ map(struct dir_info *d, size_t sz, int zero_fill)
454 } 454 }
455 if (d->free_regions_size > mopts.malloc_cache) 455 if (d->free_regions_size > mopts.malloc_cache)
456 wrterror("malloc cache", NULL); 456 wrterror("malloc cache", NULL);
457 KERNENTER(); 457 _MALLOC_LEAVE();
458 p = MMAP(sz); 458 p = MMAP(sz);
459 KERNEXIT(); 459 _MALLOC_ENTER();
460 if (p != MAP_FAILED) 460 if (p != MAP_FAILED)
461 STATS_ADD(d->malloc_used, sz); 461 STATS_ADD(d->malloc_used, sz);
462 /* zero fill not needed */ 462 /* zero fill not needed */