| 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) ); |
nothing calls this directly
no test coverage detected