MCPcopy Create free account
hub / github.com/MJx0/KittyMemoryEx / init

Method init

KittyMemoryEx/KittyMemOp.cpp:73–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 {
72 size_t requestSize = len;
73
74 if (state == KTTransferState::Page)
75 requestSize = std::min(KT_PAGE_REMAIN(address), len);
76
77 ssize_t sn = static_cast<ssize_t>(operation(address, buffer, requestSize));
78 if (sn < 0)
79 {
80 switch (sn)
81 {
82 case -ESRCH: // process exited
83 case -EBADF: // invalid fd
84 case -EPERM: // permission lost
85 case -EINVAL: // invalid arguments
86 return total;
87 default:
88 break;
89 }
90 }
91
92 size_t n = sn < 0 ? 0 : static_cast<size_t>(sn);
93
94 if (n > 0)
95 {
96 total += n;

Callers 2

initializeMethod · 0.45
dumpMemRangeMethod · 0.45

Calls 4

openMethod · 0.80
lastErrorMethod · 0.80
pathMethod · 0.80
lastStrErrorMethod · 0.80

Tested by

no test coverage detected