MCPcopy Create free account
hub / github.com/defold/defold / Writer

Function Writer

engine/script/src/script_zlib.cpp:47–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 */
46
47 static bool Writer(void* context, const void* buffer, uint32_t buffer_size)
48 {
49 dmArray<uint8_t>* out = (dmArray<uint8_t>*) context;
50 if (out->Remaining() < buffer_size) {
51 int r = out->Remaining();
52 int offset = dmMath::Max((int) buffer_size - r, 32 * 1024);
53 out->OffsetCapacity(offset);
54 }
55 out->PushArray((const uint8_t*) buffer, buffer_size);
56 return true;
57 }
58
59 /*# Inflate (decompress) a buffer
60 * A lua error is raised is on error

Callers

nothing calls this directly

Calls 4

PushArrayMethod · 0.80
MaxFunction · 0.50
RemainingMethod · 0.45
OffsetCapacityMethod · 0.45

Tested by

no test coverage detected