MCPcopy Create free account
hub / github.com/Tencent/MMKV / prepareEncode

Function prepareEncode

Core/MMKV_IO.cpp:420–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418constexpr uint32_t ItemSizeHolderSize = 4;
419
420static pair<MMBuffer, size_t> prepareEncode(const MMKVMap &dic) {
421 // make some room for placeholder
422 size_t totalSize = ItemSizeHolderSize;
423 for (auto &itr : dic) {
424 auto &kvHolder = itr.second;
425 totalSize += kvHolder.computedKVSize + kvHolder.valueSize;
426 }
427 return make_pair(MMBuffer(), totalSize);
428}
429
430#ifndef MMKV_DISABLE_CRYPT
431static pair<MMBuffer, size_t> prepareEncode(const MMKVMapCrypt &dic) {

Callers 3

ensureMemorySizeMethod · 0.85
fullWritebackMethod · 0.85
doFullWriteBackMethod · 0.85

Calls 5

encodeDataWithObjectFunction · 0.85
toMMBufferMethod · 0.80
readUInt32Method · 0.80
MMBufferFunction · 0.70
CodedInputDataClass · 0.70

Tested by

no test coverage detected