summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_mem_zone.c
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_mem_zone.c
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_mem_zone.c')
-rw-r--r--src/nxt_mem_zone.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/nxt_mem_zone.c b/src/nxt_mem_zone.c
index 67c6d746..f8ab09d9 100644
--- a/src/nxt_mem_zone.c
+++ b/src/nxt_mem_zone.c
@@ -87,48 +87,39 @@ struct nxt_mem_zone_s {
};
-#define \
-nxt_mem_zone_page_addr(zone, page) \
+#define nxt_mem_zone_page_addr(zone, page) \
(void *) (zone->start + ((page - zone->pages) << zone->page_size_shift))
-#define \
-nxt_mem_zone_addr_page(zone, addr) \
+#define nxt_mem_zone_addr_page(zone, addr) \
&zone->pages[((u_char *) addr - zone->start) >> zone->page_size_shift]
-#define \
-nxt_mem_zone_page_is_free(page) \
+#define nxt_mem_zone_page_is_free(page) \
(page->size < NXT_MEM_ZONE_PAGE_USED)
-#define \
-nxt_mem_zone_page_is_chunked(page) \
+#define nxt_mem_zone_page_is_chunked(page) \
(page->size >= 16)
-#define \
-nxt_mem_zone_page_bitmap(zone, slot) \
+#define nxt_mem_zone_page_bitmap(zone, slot) \
(slot->size < zone->small_bitmap_min_size)
-#define \
-nxt_mem_zone_set_chunk_free(map, chunk) \
+#define nxt_mem_zone_set_chunk_free(map, chunk) \
map[chunk / 8] &= ~(0x80 >> (chunk & 7))
-#define \
-nxt_mem_zone_chunk_is_free(map, chunk) \
+#define nxt_mem_zone_chunk_is_free(map, chunk) \
((map[chunk / 8] & (0x80 >> (chunk & 7))) == 0)
-#define \
-nxt_mem_zone_fresh_junk(p, size) \
+#define nxt_mem_zone_fresh_junk(p, size) \
nxt_memset((p), 0xA5, size)
-#define \
-nxt_mem_zone_free_junk(p, size) \
+#define nxt_mem_zone_free_junk(p, size) \
nxt_memset((p), 0x5A, size)