Skip to content

improve error handling #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Feb 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improve error message in destroy_pthread_attr
  • Loading branch information
lovasoa committed Feb 18, 2025
commit afb30f5800d7a9c9f913901b0eb08980d4192de7
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
// Make sure the libstacker.a (implemented in C) is linked.
// See https://github.com/rust-lang/rust/issues/65610
#[link(name="stacker")]
extern {

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Cargo.toml on windows-latest with nightly and

extern declarations without an explicit ABI are deprecated

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Cargo.toml on windows-latest with nightly and -Zminimal-versions

extern declarations without an explicit ABI are deprecated

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Cargo.toml on windows-latest with nightly and --release

extern declarations without an explicit ABI are deprecated

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Cargo.toml on x86_64-pc-windows-gnu with nightly

extern declarations without an explicit ABI are deprecated

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Cargo.toml on i686-pc-windows-gnu with nightly

extern declarations without an explicit ABI are deprecated
fn __stacker_get_current_fiber() -> *mut c_void;
}

Expand Down Expand Up @@ -407,7 +407,9 @@
} else if #[cfg(any(target_os = "linux", target_os="solaris", target_os = "netbsd"))] {
unsafe fn destroy_pthread_attr(attr: *mut libc::pthread_attr_t) {
let ret = libc::pthread_attr_destroy(attr);
assert!(ret == 0, "pthread_attr_destroy failed with error code: {}", ret);
if ret != 0 {
panic!("pthread_attr_destroy failed with error code {}: {}", ret, std::io::Error::last_os_error());
}
}

unsafe fn guess_os_stack_limit() -> Option<usize> {
Expand All @@ -431,7 +433,9 @@
} else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly", target_os = "illumos"))] {
unsafe fn destroy_pthread_attr(attr: *mut libc::pthread_attr_t) {
let ret = libc::pthread_attr_destroy(attr);
assert!(ret == 0, "pthread_attr_destroy failed with error code: {}", ret);
if ret != 0 {
panic!("pthread_attr_destroy failed with error code {}: {}", ret, std::io::Error::last_os_error());
}
}

unsafe fn guess_os_stack_limit() -> Option<usize> {
Expand Down
Loading