diff options
| author | cpplover0 <osdev555@yandex.com> | 2026-03-30 18:21:18 +0300 |
|---|---|---|
| committer | cpplover0 <osdev555@yandex.com> | 2026-03-30 18:21:18 +0300 |
| commit | 8844a7888ea94a11939b1c92915162f2e5acd378 (patch) | |
| tree | 1b4ef74fde17d6f8bb6e054f3266e9342b41c836 /kernel/src/utils | |
| parent | be997311c240f49db247ccce05ecb8ea5d3bfc31 (diff) | |
Diffstat (limited to 'kernel/src/utils')
| -rw-r--r-- | kernel/src/utils/align.hpp | 4 | ||||
| -rw-r--r-- | kernel/src/utils/ringbuffer.hpp | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/kernel/src/utils/align.hpp b/kernel/src/utils/align.hpp index 2f2c665..f361185 100644 --- a/kernel/src/utils/align.hpp +++ b/kernel/src/utils/align.hpp @@ -1,2 +1,4 @@ #define ALIGNUP(VALUE, c) ((VALUE + c - 1) & ~(c - 1)) -#define ALIGNDOWN(VALUE, c) ((VALUE / c) * c)
\ No newline at end of file +#define ALIGNDOWN(VALUE, c) ((VALUE / c) * c) +#define ALIGNPAGEUP(VALUE) ALIGNUP(VALUE, 4096) +#define ALIGNPAGEDOWN(VALUE) ALIGNDOWN(VALUE, 4096)
\ No newline at end of file diff --git a/kernel/src/utils/ringbuffer.hpp b/kernel/src/utils/ringbuffer.hpp index d6f6c2c..12b2ef2 100644 --- a/kernel/src/utils/ringbuffer.hpp +++ b/kernel/src/utils/ringbuffer.hpp @@ -46,8 +46,6 @@ namespace utils { objs[tail].cycle = cycle; objs[tail].data = item; - write_counter++; - if (++tail == size) { tail = 0; cycle = !cycle; @@ -69,7 +67,6 @@ namespace utils { while (count < max && objs[q].cycle == (std::uint32_t)c) { out[count] = objs[q].data; - read_counter++; if (++q == size) { q = 0; @@ -85,7 +82,6 @@ namespace utils { return count; } - std::uint64_t get_write_count() const { return write_counter; } }; }
\ No newline at end of file |
