mirror of
https://github.com/isar/rusqlite.git
synced 2025-10-15 09:12:26 +08:00
Introduce alloc
to generate C string allocated by sqlite3
Safe to send to SQLite for deallocation.
This commit is contained in:
@@ -372,25 +372,19 @@ rusqlite was built against SQLite {} but the runtime SQLite version is {}. To fi
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(not(any(
|
||||
target_arch = "wasm32"
|
||||
)))]
|
||||
#[cfg(not(any(target_arch = "wasm32")))]
|
||||
static SQLITE_INIT: std::sync::Once = std::sync::Once::new();
|
||||
|
||||
pub static BYPASS_SQLITE_INIT: AtomicBool = AtomicBool::new(false);
|
||||
|
||||
// threading mode checks are not necessary (and do not work) on target
|
||||
// platforms that do not have threading (such as webassembly)
|
||||
#[cfg(any(
|
||||
target_arch = "wasm32"
|
||||
))]
|
||||
#[cfg(any(target_arch = "wasm32"))]
|
||||
fn ensure_safe_sqlite_threading_mode() -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(any(
|
||||
target_arch = "wasm32"
|
||||
)))]
|
||||
#[cfg(not(any(target_arch = "wasm32")))]
|
||||
fn ensure_safe_sqlite_threading_mode() -> Result<()> {
|
||||
// Ensure SQLite was compiled in thredsafe mode.
|
||||
if unsafe { ffi::sqlite3_threadsafe() == 0 } {
|
||||
|
Reference in New Issue
Block a user