MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxWriteChunkArray

Function fxWriteChunkArray

xs/sources/xsSnapshot.c:1997–2021  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1995}
1996
1997void fxWriteChunkArray(txMachine* the, txSnapshot* snapshot, txSlot* address, txSize length, txFlag flag)
1998{
1999 txChunk* chunk = (txChunk*)(((txByte*)(address)) - sizeof(txChunk));
2000 if (chunk->size & mxChunkFlag) {
2001 txByte* temporary = chunk->temporary;
2002 chunk->size &= ~mxChunkFlag;
2003 chunk->temporary = C_NULL;
2004 txSize size;
2005 mxThrowIf((*snapshot->write)(snapshot->stream, chunk, sizeof(txChunk)));
2006 chunk->temporary = temporary;
2007 size = chunk->size - sizeof(txChunk);
2008 while (size > 0) {
2009 fxWriteSlot(the, snapshot, address, flag);
2010 address++;
2011 size -= sizeof(txSlot);
2012 }
2013 address = (txSlot*)(((txByte*)(chunk)) + sizeof(txChunk));
2014 size = chunk->size - sizeof(txChunk);
2015 while (size > 0) {
2016 fxWriteChunk(the, snapshot, address);
2017 address++;
2018 size -= sizeof(txSlot);
2019 }
2020 }
2021}
2022
2023void fxWriteChunkBigInt(txMachine* the, txSnapshot* snapshot, void* address, txSize size)
2024{

Callers 1

fxWriteChunkFunction · 0.85

Calls 2

fxWriteSlotFunction · 0.85
fxWriteChunkFunction · 0.85

Tested by

no test coverage detected