summaryrefslogtreecommitdiff
path: root/lib/libc/include/malloc.h
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-09 23:14:53 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-09 23:14:53 +0100
commit169daa11155988a210fac949297381743f3cb400 (patch)
tree602ef5df5ae9ea075ab3d5dac3c8ad60da1ea2cc /lib/libc/include/malloc.h
parent4e2112e165fdd94dee58378e3ea32892f3710cd7 (diff)
feat: clang-tidy fixes
Diffstat (limited to 'lib/libc/include/malloc.h')
-rw-r--r--lib/libc/include/malloc.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/include/malloc.h b/lib/libc/include/malloc.h
index ba2755b0..b7cb0093 100644
--- a/lib/libc/include/malloc.h
+++ b/lib/libc/include/malloc.h
@@ -1,9 +1,8 @@
#ifndef __LIBC_MALLOC_H
#define __LIBC_MALLOC_H
-#include <stddef.h>
-#include <stdint.h>
#include <stdatomic.h>
+#include <stdint.h>
struct class {
uint32_t size;
@@ -47,11 +46,12 @@ extern struct page *__malloc_pvec;
#define LARGE_PAGE_MASK (~((uintptr_t)LARGE_PAGE_SIZE - 1))
#define SMALL_CLASS(n) \
- { (n * 16), (SMALL_PAGE_SIZE - sizeof(struct page)) / (n * 16) }
+ { (((n)) * 16), (SMALL_PAGE_SIZE - sizeof(struct page)) / (((n)) * 16) }
#define MEDIUM_CLASS(n) \
- { (n * 16), (MEDIUM_PAGE_SIZE - sizeof(struct page)) / (n * 16) }
+ { (((n)) * 16), \
+ (MEDIUM_PAGE_SIZE - sizeof(struct page)) / (((n)) * 16) }
#define LARGE_CLASS(n) \
- { (n * 16), (LARGE_PAGE_SIZE - sizeof(struct page)) / (n * 16) }
+ { (((n)) * 16), (LARGE_PAGE_SIZE - sizeof(struct page)) / (((n)) * 16) }
static const struct class global_size_class[] = {
SMALL_CLASS(1), SMALL_CLASS(1), SMALL_CLASS(2),