Skip to content

Commit

Permalink
print arch on init
Browse files Browse the repository at this point in the history
  • Loading branch information
lingol committed May 26, 2021
1 parent 6f9e3ad commit 947f685
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public void loadLibrary(String libName) {
}
}, MMKVLogLevel.LevelInfo);
Log.i("MMKV", "mmkv root: " + rootDir);
Log.i("MMKV", "mmkv version: " + MMKV.version());

// set log level
MMKV.setLogLevel(MMKVLogLevel.LevelInfo);
Expand Down
2 changes: 1 addition & 1 deletion Core/MMKV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void initialize() {
g_instanceLock->initialize();

mmkv::DEFAULT_MMAP_SIZE = mmkv::getPageSize();
MMKVInfo("version %s page size:%d", MMKV_VERSION, DEFAULT_MMAP_SIZE);
MMKVInfo("version %s, page size %d, arch %s", MMKV_VERSION, DEFAULT_MMAP_SIZE, MMKV_ABI);

// get CPU status of ARMv8 extensions (CRC32, AES)
#if defined(__aarch64__) && defined(__linux__)
Expand Down
34 changes: 33 additions & 1 deletion Core/MMKVPredef.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <vector>
#include <unordered_map>

constexpr auto MMKV_VERSION = "v1.2.8";
constexpr auto MMKV_VERSION = "v1.2.9";

#ifdef DEBUG
# define MMKV_DEBUG
Expand Down Expand Up @@ -208,4 +208,36 @@ constexpr size_t AES_KEY_BITSET_LEN = 128;

#endif //cplus-plus

#if defined(__arm__)
#if defined(__ARM_ARCH_7A__)
#if defined(__ARM_NEON__)
#if defined(__ARM_PCS_VFP)
#define MMKV_ABI "armeabi-v7a/NEON (hard-float)"
#else
#define MMKV_ABI "armeabi-v7a/NEON"
#endif
#else
#if defined(__ARM_PCS_VFP)
#define MMKV_ABI "armeabi-v7a (hard-float)"
#else
#define MMKV_ABI "armeabi-v7a"
#endif
#endif
#else
#define MMKV_ABI "armeabi"
#endif
#elif defined(__i386__)
#define MMKV_ABI "x86"
#elif defined(__x86_64__)
#define MMKV_ABI "x86_64"
#elif defined(__mips64)
#define MMKV_ABI "mips64"
#elif defined(__mips__)
#define MMKV_ABI "mips"
#elif defined(__aarch64__)
#define MMKV_ABI "arm64-v8a"
#else
#define MMKV_ABI "unknown"
#endif

#endif //MMKV_SRC_MMKVPREDEF_H

0 comments on commit 947f685

Please sign in to comment.