File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 6868//!
6969//! ```c
7070//! /* C header */
71- //! struct Foo* foo( ); /* Returns ownership */
72- //! void bar (struct Foo*); /* `bar` takes ownership */
71+ //! struct Foo* foo_new(void ); /* Returns ownership to the caller */
72+ //! void foo_delete (struct Foo*); /* Takes ownership from the caller */
7373//! ```
7474//!
7575//! ```
7676//! #[repr(C)]
7777//! pub struct Foo;
7878//!
7979//! #[no_mangle]
80- //! pub extern "C" fn foo () -> Box<Foo> {
80+ //! pub extern "C" fn foo_new () -> Box<Foo> {
8181//! Box::new(Foo)
8282//! }
8383//!
8484//! #[no_mangle]
85- //! pub extern "C" fn bar (_: Option<Box<Foo>>) {}
85+ //! pub extern "C" fn foo_delete (_: Option<Box<Foo>>) {}
8686//! ```
8787//!
8888//! [dereferencing]: ../../std/ops/trait.Deref.html
You can’t perform that action at this time.
0 commit comments