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

Method write

src/simulate/bin_serializer.cpp:43–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 }
42 }
43 __forceinline void write ( void * data, uint32_t size ) {
44 if ( bytesWritten + size > bytesAllocated ) {
45 uint32_t newSize = das::max ( bytesAllocated + bytesGrow, bytesWritten + size );
46 bytesAt = context->reallocate(bytesAt, bytesAllocated, newSize, debugInfo);
47 context->heap->mark_comment(bytesAt, "binary serializer write");
48 bytesAllocated = newSize;
49 }
50 DEBUG_BIN_DATA("writing %i bytes at %i\n", size, bytesWritten );
51 memcpy ( bytesAt + bytesWritten, data, size );
52 bytesWritten += size;
53 }
54 template <typename TT>
55 __forceinline void save ( TT & data ) {
56 write ( &data, sizeof(TT) );

Callers

nothing calls this directly

Calls 1

reallocateMethod · 0.45

Tested by

no test coverage detected