Page 1 of 1

[PB 6.12 | Ubuntu 24.04] MemoryStatus(#PB_System_TotalSwap) and MemoryStatus(#PB_System_FreeSwap) truncated to long

Posted: Thu Mar 05, 2026 7:51 pm
by Naheulf
Hi!
On my computer I have more than 4GiB of swap and PureBasic returned... a negative value for that amount :shock: .
If I take the #PB_System_TotalSwap value it return -245727232 (or $FFFFFFFFF15A8000). However the `swapon --bytes` command output is

Code: Select all

naheulf@nn:~$ swapon --bytes
NAME       TYPE            SIZE       USED PRIO
/swap.img  file      4294963200    1462272   -2
/dev/zram0 partition 8344211456 2184970240    5
naheulf@nn:~$
And so total swap size is 12639174656 (or $00000002F15A8000)...

Note 1: I view it on PB 6.12 but the bug is also present in both PB 6.30 and the current PB 6.40 alpha.
Note 2: Also tested the C backend on both PB 6.30 and PB 6.40 alpha and this still give the same output.