diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-07-28 18:08:22 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-28 18:08:22 +0530 |
commit | ef7bc2e6cc4856a0372086b3ceb7d470508aaa52 (patch) | |
tree | 02045406d0fe21bf77bcb3697ed2e75006aebeed /test_ffi/src | |
parent | 519ed44ebb4bab71c6b80f7c1ef432354654da8c (diff) |
perf(ext/ffi): use fast api calls for 64bit return types (#15313)
Diffstat (limited to 'test_ffi/src')
-rw-r--r-- | test_ffi/src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test_ffi/src/lib.rs b/test_ffi/src/lib.rs index bc89bd66c..b061ca8d5 100644 --- a/test_ffi/src/lib.rs +++ b/test_ffi/src/lib.rs @@ -404,3 +404,10 @@ pub struct Structure { #[no_mangle] pub static mut static_ptr: Structure = Structure { _data: 42 }; + +static STRING: &str = "Hello, world!\0"; + +#[no_mangle] +extern "C" fn ffi_string() -> *const u8 { + STRING.as_ptr() +} |