Last active
July 26, 2025 14:27
-
-
Save pronebird/c8877543c58e25718a0f63fc479ff8e8 to your computer and use it in GitHub Desktop.
Rust: get stack size in bytes on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn get_stack_size() -> usize { | |
| let mut low: usize = 0; | |
| let mut high: usize = 0; | |
| unsafe { | |
| windows::Win32::System::Threading::GetCurrentThreadStackLimits( | |
| &mut low as _, | |
| &mut high as _, | |
| ) | |
| }; | |
| high - low | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment