MCPcopy Create free account
hub / github.com/alibaba/MNN / MNNReadFile

Function MNNReadFile

source/core/MNNFileUtils.cpp:214–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214size_t MNNReadFile(file_t file, void * buf, size_t bytes)
215{
216 if (file == INVALID_FILE || buf == nullptr) {
217 return 0;
218 }
219#if defined(WIN32) || defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)
220 DWORD readbytes = 0;
221 if (ReadFile(file, buf, bytes, &readbytes, NULL)) {
222 return readbytes;
223 } else {
224 return 0;
225 }
226#else
227 return read(file, buf, bytes);
228#endif
229}
230
231size_t MNNWriteFile(file_t file, void * buf, size_t bytes)
232{

Callers 1

runMethod · 0.85

Calls 2

readFunction · 0.85
ReadFileFunction · 0.50

Tested by 1

runMethod · 0.68