MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / write

Method write

framework/data_source/cache/slice.cpp:48–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 }
47
48 int slice::write(const void *buffer, int size)
49 {
50 if (mBufferPtr == nullptr) {
51 mAlloc = true;
52 mBufferPtr = new uint8_t[mCapacity];
53 }
54
55 if (size == 0) {
56 return 0;
57 }
58
59 int writeSize = (int) MIN(size, mCapacity - mSize);
60
61 if (writeSize == 0) {
62 return -ENOSPC;
63 }
64
65 memcpy(mBufferPtr + mSize, buffer, static_cast<size_t>(writeSize));
66 mSize += writeSize;
67 return writeSize;
68 }
69
70 int slice::readAt(void *buffer, int size, uint64_t offset)
71 {

Callers 15

testSliceFunction · 0.45
writeAtMethod · 0.45
testProtocolFunction · 0.45
testMessageFunction · 0.45
appendToFileMethod · 0.45
WriteLogMethod · 0.45
copyFromAssetToSdcardMethod · 0.45
postMethod · 0.45
copyAssetsToDstMethod · 0.45
sv_insert_fill_charsFunction · 0.45
sv_insert_alignedFunction · 0.45
string_view.hppFile · 0.45

Calls

no outgoing calls

Tested by 3

testSliceFunction · 0.36
testProtocolFunction · 0.36
testMessageFunction · 0.36