Skip to content

Commit 0380f4d

Browse files
Made nstd_os_unix_shared_lib_free unsafe.
1 parent 202f01a commit 0380f4d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

include/nstd/os/unix/shared_lib.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ NSTDAPI NSTDAnyMut nstd_os_unix_shared_lib_get_mut(NSTDUnixSharedLib *lib, const
6666
/// # Parameters:
6767
///
6868
/// - `NSTDUnixSharedLib lib` - A handle to the loaded library to unload.
69+
///
70+
/// # Safety
71+
///
72+
/// See <https://man7.org/linux/man-pages/man3/dlclose.3p.html>.
6973
NSTDAPI void nstd_os_unix_shared_lib_free(NSTDUnixSharedLib lib);
7074

7175
#endif

src/os/unix/shared_lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ pub unsafe extern "C" fn nstd_os_unix_shared_lib_get_mut(
9898
/// # Parameters:
9999
///
100100
/// - `NSTDUnixSharedLib lib` - A handle to the loaded library to unload.
101+
///
102+
/// # Safety
103+
///
104+
/// See <https://man7.org/linux/man-pages/man3/dlclose.3p.html>.
101105
#[inline]
102106
#[cfg_attr(feature = "clib", no_mangle)]
103107
#[allow(unused_variables)]
104-
pub extern "C" fn nstd_os_unix_shared_lib_free(lib: NSTDUnixSharedLib) {}
108+
pub unsafe extern "C" fn nstd_os_unix_shared_lib_free(lib: NSTDUnixSharedLib) {}

0 commit comments

Comments
 (0)