An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.
mmkv
to mmkvflutter
is needed.lstat()
, fstat()
, NSUserDefaults
).removeStorage()
static method to safely delete underlying files of an MMKV instance.null
is returned when the value is in fact an empty ByteArray.FastNative
naming conflict.androidx.annotation
to v1.7.1.memcpy()
.MMKV_DISABLE_CRYPT
is on.Among most of the features added in this version, the credit goes to @kaitian521.
SINGLE_PROCESS_MODE
.SINGLE_PROCESS_MODE
.clearAll()
with keeping file disk space unchanged, reducing the need to expand file size on later insert & update operations. This feature is off by default, you will have to call it with relative params or newly added methods.zeroFill()
, will lead to a crash.std::exception
.-O2
optimization level by default, which will reduce native lib size and improve read/write speed a little bit.@fastNative
annotation on enableCompareBeforeCompare()
to speed up JNI call.-Wl,-weak_reference_mismatches,weak
or -Wl,-ld_classic
options to the OTHER_LDFLAGS
build setting of Xcode 15. Note that these options are not recognized by older versions of Xcode.This is a hotfix version. It's highly recommended that v1.2.16 & v1.3.0 users upgrade as soon as possible.
count()
& allKeys()
methods when auto key expiration is turn on.msync()
call on newly created MMKV instances.initialize()
.lock()
/unlock()
/try_lock()
is not thread-safe.sdkInt
, avoid unnecessary risk on Android App Review.+[MMKV initializeMMKV:]
manually before calling any MMKV methods.MMKV.getXXX()
may return invalid results in multi-process mode.[]
instead of null
on empty StringSet
from MMKV.decodeStringSet()
methods.32
.-[MMKV getObject:forKey:]
method when the key-value doesn't exist.MMKV_DISABLE_CRYPT
macro is defined.-[MMKV getXXX:forKey:hasValue:]
methods.MMKV::getXXX(key, defaultValue, hasValue)
methods.MMKV::getXXX(key, defaultValue, hasValue)
methods.