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

Function pyBytes2MMBuffer

Python/libmmkv_python.cpp:53–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53static MMBuffer pyBytes2MMBuffer(const py::bytes &bytes) {
54 char *buffer = nullptr;
55 ssize_t length = 0;
56 if (PYBIND11_BYTES_AS_STRING_AND_SIZE(bytes.ptr(), &buffer, &length) == 0) {
57 return {buffer, static_cast<size_t>(length), MMBufferNoCopy};
58 }
59 return MMBuffer(0);
60}
61
62static function<void(MMKVLogLevel level, const char *file, int line, const char *function, const string &message)>
63 g_logHandler = nullptr;

Callers 1

PYBIND11_MODULEFunction · 0.85

Calls 1

MMBufferStruct · 0.50

Tested by

no test coverage detected