李通洲
ff7e81ed81
Memory (Windows): adds comments [ci skip]
2026-02-11 21:47:20 +08:00
李通洲
dc04273bd7
Memory (macOS): updates algorithm in order not to use hw.memsize_usable which is available on newer macOS version
...
Adds a new CMake option to use usable memory size at the same time
Fixes #2171
2026-01-29 09:34:50 +08:00
李通洲
e44df27c96
Memory (macOS): adds debug info
...
Usage: `fastfetch -s memory:swap -l none --dynamic-interval 1000 --debug --no-buffer`
See https://github.com/fastfetch-cli/fastfetch/issues/2171#issuecomment-3803309478
2026-01-27 14:24:38 +08:00
李通洲
4d185e64ac
SunOS: silences compiler warnings
2026-01-07 18:38:44 +08:00
Carter Li
d60b25e424
Refactor: renames src/util to src/common
2026-01-06 09:48:38 +08:00
Carter Li
61690a1804
Util: moves util/io/io.h to util/io.h
2026-01-06 09:13:40 +08:00
李通洲
1e43e35857
Chore: merges common/* into util/*
2026-01-05 17:54:41 +08:00
李通洲
610fc2ea36
Memory (macOS): Refines Memory usage detection on macOS to match Activity Monitor more closely
2025-12-18 13:36:38 +08:00
李通洲
94941daf4f
Memory (macOS): uses hw.memsize_usable
2025-12-16 10:41:27 +08:00
Carter Li
5d8c21a5ca
Memory (Linux): fallbacks to calcuate ourselves when MemAvailable seems unreasonable
...
Fixes #1988
2025-10-02 07:39:20 +08:00
李通洲
75d2c668d0
Modules: refactor module option handling for static allocation
...
Moves module option structs out of global config and removes dynamic allocation, using static buffers and size assertions for safer, simpler management.
Refactors module initialization and destruction to work with isolated option structs, eliminating the need for the previous modules container and related code.
Unifies module option header usage and updates detection logic to leverage statically-sized option buffers, improving encapsulation and maintainability.
Simplifies module function signatures and reduces coupling between modules and config.
Enhances future extensibility and reliability by enforcing max size constraints and removing unnecessary indirections.
2025-08-04 14:46:01 +08:00
李通洲
64d4035cae
Chore (Haiku): don't use hard-coded page size
2025-06-04 21:26:37 +08:00
François Revol
01f400c15f
Haiku: minimal implementation ( #1538 )
2025-02-05 09:08:28 +08:00
carterli
fc969b01c7
Memory (NetBSD): change formula to be consistant with other systems
2025-01-13 10:47:25 +08:00
carterli
41e22ea866
Memory (OpenBSD): update formula to be consistant with other systems
2025-01-13 10:47:25 +08:00
Carter Li
e7630aef34
NetBSD: support CPUUsage / Memory / Swap
2024-10-28 16:10:20 +08:00
李通洲
4665fdd145
Global: make it compile on NetBSD
...
Doesn't work yet.
2024-10-27 11:43:36 +08:00
李通洲
b257134d74
Chore: introduce macro ARRAY_SIZE
2024-10-18 16:44:41 +08:00
李通洲
cd9cfa5d99
Memory (SunOS): simplify
2024-10-11 14:48:56 +08:00
李通洲
ded38efb1a
Memory (OpenBSD): fix detection of used memory size
...
Fix #1331
2024-10-11 14:48:11 +08:00
apocelipes
84cc9e3b15
Chore: fix some unused paramater/function warnings ( #1324 )
2024-10-06 23:01:49 +08:00
Carter Li
a32d9d788c
OpenBSD: init platform support
2024-10-04 17:49:18 +08:00
Carter Li
a749014e7c
Kernel: code refactor
2024-07-02 10:47:14 +08:00
Carter Li
72d332772d
SunOS: support memory usage detection
2024-06-17 15:52:45 +08:00
Carter Li
d35490aeef
Fastfetch: make it compile on SunOS
2024-06-16 01:02:48 +08:00
李通洲
e804dfc49e
Memory (macOS): align algo of memory usage counting to stats
...
Which seems to print the same result of neofetch
2023-12-14 16:13:05 +08:00
李通洲
a9c5c2892c
Memory (Linux): Use MemAvailable if available
2023-12-07 16:30:10 +08:00
apocelipes
1c24cb3ebb
refactor: simplify parsing
2023-12-04 19:47:34 +08:00
apocelipes
6eae425679
fix(Memory): fix reading procfs files and simplify data parsing
...
Files in procfs are always changed by kernel.
It means if we read the data with more than one read syscall,
we could get an incorrect data which was broken by kernel.
A typical case about this problem was reported by psutil in
https://github.com/giampaolo/psutil/issues/2050
Using an big buffer let read reads the whole file can fix this.
psutil uses a 32K buffer while procps-ng uses a 8K buffer, i think a 8K buffer is enough.
2023-12-04 19:47:34 +08:00
李通洲
f63f31db0a
Memory (Linux): fix compiler warnings
2023-11-25 19:40:36 +08:00
李通洲
96d60184d5
Memory (Linux): try improving performance
2023-11-24 10:12:34 +08:00
Marius Messerschmidt
6fe0eb5677
ClangTidy: avoid different parameter names for same function
2023-11-18 12:31:57 +01:00
李通洲
f9597eba39
Global: remove #ifndef FF_INCLUDED_* guards
2023-11-09 13:46:45 +08:00
李通洲
3e0d97db2e
Platform: detect system page size
2023-11-08 00:10:16 +08:00
李通洲
eb308e1861
Memory (BSD): fix building on 32-bit FreeBSD
...
fix #538
2023-08-25 08:47:16 +08:00
李通洲
a059c55f05
Memory (FreeBSD): count cached memory as free memory
...
As what neofetch did
2023-07-02 10:30:21 +08:00
李通洲
e837e1e1d1
Swap: split module code from memory.c
2023-05-11 22:03:18 +08:00
李通洲
725d2f2612
Windows: fix <Windows.h> header mess
2023-03-25 00:50:40 +08:00
李通洲
9a3909f8ba
Memory (Windows): check for error cases
2023-02-16 17:19:43 +08:00
李通洲
e2d145cf31
Memory (Apple): use sysctl instead of sysctlbyname
2023-02-14 17:31:07 +08:00
李通洲
6ff67e87eb
Memory: refactor, don't cache results
2022-12-28 17:20:20 +08:00
李通洲
19c5904561
Memory: improve performance by not querying WMI (Windows)
2022-11-21 15:45:53 +08:00
李通洲
581c6f547d
Swap: split code out from memory detection
...
1. Since swap module is disabled by default, swap detection is unnecessary in most cases.
2. On platform other than Linux, swap detection doesn't share code with memory.
3. Swap detection can be expensive. On Windows, it requires another WMI query which can lag heavily in some cases. Don't pay for you don't use.
2022-10-19 00:24:17 +08:00
李通洲
38b3aae1e3
Windows: simplify WMI query code
...
by making C++ code more C++
2022-10-17 00:17:26 +08:00
李通洲
3d2497f963
macOS: fix compile warnings
2022-10-11 19:19:43 +08:00
李通洲
0a55071f88
Memory: add support for Windows
2022-10-09 15:37:14 +08:00
Linus Dierheimer
b8656d5e12
Fix build on BSD
2022-09-29 12:24:00 +02:00
Linus Dierheimer
40588e1a39
Fix build on MacOS
...
#261
2022-09-29 11:35:59 +02:00
李通洲
3068b5bcb2
Memory: fix percentage calculation
2022-09-21 18:10:50 +08:00
Linus Dierheimer
01a917982c
Fix build on macos
2022-09-20 15:21:39 +02:00