MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / _builtin_binary_save

Function _builtin_binary_save

src/simulate/bin_serializer.cpp:293–305  ·  view source on GitHub ↗

save ( obj, block<(bytesAt)> )

Source from the content-addressed store, hash-verified

291
292 // save ( obj, block<(bytesAt)> )
293 vec4f _builtin_binary_save ( Context & context, SimNode_CallBase * call, vec4f * args ) {
294 BinDataSerialize writer(context, &call->debugInfo);
295 // args
296 Block * block = cast<Block *>::to(args[1]);
297 auto info = call->types[0];
298 writer.walk(args[0], info);
299 writer.close();
300 Array arr;
301 array_mark_locked(arr, writer.bytesAt, writer.bytesWritten);
302 vec4f arg = cast<char *>::from((char *)&arr);
303 context.invoke(*block, &arg, nullptr, &call->debugInfo);
304 return v_zero();
305 }
306
307 // load ( obj, bytesAt )
308 void _builtin_binary_load ( Context & context, LineInfo * at, TypeInfo* info, const char *data, uint64_t len, char *to) {

Callers

nothing calls this directly

Calls 6

toFunction · 0.85
array_mark_lockedFunction · 0.85
v_zeroFunction · 0.50
walkMethod · 0.45
closeMethod · 0.45
invokeMethod · 0.45

Tested by

no test coverage detected