Skip to content
Merged
Show file tree
Hide file tree
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
Review
  • Loading branch information
bschoenmaeckers committed May 26, 2026
commit a34acf08074048a54b6e8c5bfda197c13622bc98
10 changes: 8 additions & 2 deletions crates/capi/src/pycapsule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ pub unsafe extern "C" fn PyCapsule_GetContext(capsule: *mut PyObject) -> *mut c_
}
Comment thread
bschoenmaeckers marked this conversation as resolved.

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyCapsule_SetContext(capsule: *mut PyObject, context: *mut c_void) -> c_int {
pub unsafe extern "C" fn PyCapsule_SetContext(
capsule: *mut PyObject,
context: *mut c_void,
) -> c_int {
with_vm(|vm| {
let capsule = unsafe { &*capsule }
.downcast_ref_if_exact::<PyCapsule>(vm)
Expand All @@ -63,7 +66,10 @@ pub unsafe extern "C" fn PyCapsule_SetContext(capsule: *mut PyObject, context: *
}
Comment thread
bschoenmaeckers marked this conversation as resolved.

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyCapsule_SetPointer(capsule: *mut PyObject, pointer: *mut c_void) -> c_int {
pub unsafe extern "C" fn PyCapsule_SetPointer(
capsule: *mut PyObject,
pointer: *mut c_void,
) -> c_int {
with_vm(|vm| {
let capsule = unsafe { &*capsule }
.downcast_ref_if_exact::<PyCapsule>(vm)
Expand Down
2 changes: 1 addition & 1 deletion crates/vm/src/builtins/capsule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl PyCapsule {
.store(context, core::sync::atomic::Ordering::Relaxed);
}

pub fn name(&self) -> Option<&'static CStr> {
pub fn name(&self) -> Option<&CStr> {
self.name
}

Expand Down
Loading