summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_malloc.h
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2022-06-02 16:51:49 +0400
committerKonstantin Pavlov <thresh@nginx.com>2022-06-02 16:51:49 +0400
commitd9fddee1dbfc1f5d49c8f40386289d7188030952 (patch)
tree842a62b343ac33eba10e7a426a10b55bb1c46aed /src/nxt_malloc.h
parent420395ee2e7cd464e157c49bea3d74f15bf25f30 (diff)
parent0d48fe73c4450901622373e35f6ff3a944ec13d6 (diff)
downloadunit-d9fddee1dbfc1f5d49c8f40386289d7188030952.tar.gz
unit-d9fddee1dbfc1f5d49c8f40386289d7188030952.tar.bz2
Merged with the default branch.1.27.0-1
Diffstat (limited to 'src/nxt_malloc.h')
-rw-r--r--src/nxt_malloc.h27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/nxt_malloc.h b/src/nxt_malloc.h
index ccc3e1ef..fd5493a5 100644
--- a/src/nxt_malloc.h
+++ b/src/nxt_malloc.h
@@ -24,8 +24,7 @@ NXT_EXPORT void nxt_free(void *p);
#else
-#define \
-nxt_free(p) \
+#define nxt_free(p) \
free(p)
#endif
@@ -54,12 +53,10 @@ nxt_free(p) \
* Glibc malloc_usable_size() is fast operation.
*/
-#define \
-nxt_malloc_usable_size(p, size) \
+#define nxt_malloc_usable_size(p, size) \
size = malloc_usable_size(p)
-#define \
-nxt_malloc_cutback(cutback, size) \
+#define nxt_malloc_cutback(cutback, size) \
size = ((cutback) && size > 127 * 1024) ? size - 32 : size
#elif (NXT_FREEBSD)
@@ -81,12 +78,10 @@ nxt_malloc_cutback(cutback, size) \
* are lesser than 1M. Larger allocations require mutex acquiring.
*/
-#define \
-nxt_malloc_usable_size(p, size) \
+#define nxt_malloc_usable_size(p, size) \
size = malloc_usable_size(p)
-#define \
-nxt_malloc_cutback(cutback, size)
+#define nxt_malloc_cutback(cutback, size)
#endif
@@ -103,20 +98,16 @@ nxt_malloc_cutback(cutback, size)
* malloc_good_size() is faster than malloc_size()
*/
-#define \
-nxt_malloc_usable_size(p, size) \
+#define nxt_malloc_usable_size(p, size) \
size = malloc_good_size(size)
-#define \
-nxt_malloc_cutback(cutback, size)
+#define nxt_malloc_cutback(cutback, size)
#else
-#define \
-nxt_malloc_usable_size(p, size)
+#define nxt_malloc_usable_size(p, size)
-#define \
-nxt_malloc_cutback(cutback, size)
+#define nxt_malloc_cutback(cutback, size)
#endif