Inside the updateChunkWriteStatsAndSplitIfNeeded function, there exists logic to check whether a particular chunk should be split, using the calculateDesiredChunkSize function to return the splitThreshold.
The calculation of splitThreshold should be moved into the addBytesWritten function inside of chunk.cpp.