diff options
| author | Bug Magnet <marco.nikic@mullvad.net> | 2025-05-23 13:35:32 +0200 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2025-05-23 13:35:32 +0200 |
| commit | 976b143a220b1b65a2a4d7004cd40688c25da79b (patch) | |
| tree | f6cc7c07f02eb52a756e167f721e4322b96611f8 /ios/MullvadRustRuntime/include | |
| parent | 3d0954f14315e3d58be5e2bb7f4c8b37bc18ac5f (diff) | |
| parent | 33b9ccf8c8da011cc5fb4cf065f1c7234f0e7174 (diff) | |
| download | mullvadvpn-976b143a220b1b65a2a4d7004cd40688c25da79b.tar.xz mullvadvpn-976b143a220b1b65a2a4d7004cd40688c25da79b.zip | |
Merge branch 'remove-dispatch-queue-hack'
Diffstat (limited to 'ios/MullvadRustRuntime/include')
| -rw-r--r-- | ios/MullvadRustRuntime/include/mullvad_rust_runtime.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ios/MullvadRustRuntime/include/mullvad_rust_runtime.h b/ios/MullvadRustRuntime/include/mullvad_rust_runtime.h index 70c1428098..08bb177116 100644 --- a/ios/MullvadRustRuntime/include/mullvad_rust_runtime.h +++ b/ios/MullvadRustRuntime/include/mullvad_rust_runtime.h @@ -77,6 +77,15 @@ typedef struct SwiftRetryStrategy { struct RetryStrategy *_0; } SwiftRetryStrategy; +/** + * A struct used to deallocate a pointer to a C String later than when the pointer's control is relinquished from Swift. + * Use the `deallocate_ptr` function on `ptr` to call the custom deallocator provided by Swift. + */ +typedef struct LateStringDeallocator { + const char *ptr; + void (*deallocate_ptr)(const char*); +} LateStringDeallocator; + typedef struct SwiftMullvadApiResponse { uint8_t *body; uintptr_t body_size; @@ -316,7 +325,7 @@ struct SwiftCancelHandle mullvad_ios_delete_account(struct SwiftApiContext api_c * `rawAddressCacheProvider` **must** be provided by a call to `init_swift_address_cache_wrapper` * It is okay to persist it, and use it accross multiple threads. */ -extern const char *swift_get_cached_endpoint(const void *rawAddressCacheProvider); +extern struct LateStringDeallocator swift_get_cached_endpoint(const void *rawAddressCacheProvider); /** * Called by the Swift side in order to provide an object to rust that provides API addresses in a UTF-8 string form |
