From d95b4ecaaa3b3fa14a37df66fc4b492b4712c463 Mon Sep 17 00:00:00 2001 From: "kexuan.yang" Date: Tue, 30 Apr 2024 00:41:55 +0800 Subject: [PATCH] Update doc & add strip flag for release build Signed-off-by: kexuan.yang --- .cargo/config.toml | 1 + src/mmkv.rs | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 60d4b82..eafe26e 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -7,3 +7,4 @@ opt-level = 'z' lto = true codegen-units = 1 panic = 'abort' +strip = true diff --git a/src/mmkv.rs b/src/mmkv.rs index 17192ff..f6dd28d 100644 --- a/src/mmkv.rs +++ b/src/mmkv.rs @@ -86,11 +86,8 @@ impl MMKV { Initialize the MMKV instance with a writeable directory, absolute or relative paths are acceptable. - All API calls(except [set_logger](MMKV::set_logger), [set_log_level](MMKV::set_log_level)) - before initialization will panic. - - Calling [initialize](MMKV::initialize) multiple times is allowed, - the old instance will be closed (see [close](MMKV::close)), the last call will take over. + Calling [new](MMKV::new) multiple times with same parameter `dir` will get different MMKV + instances share the same mmap, it's safe to call get or put concurrently on these instances. If enabled feature "encryption", additional param `key` is required, the key should be a hexadecimal string of length 16, for example: