MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / put3

Method put3

src/dsql/DsqlBatch.cpp:824–848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

822}
823
824void DsqlBatch::DataCache::put3(const void* data, ULONG dataSize, ULONG offset)
825{
826 fb_assert((DsqlBatch::RAM_BATCH % dataSize == 0) && (offset % dataSize == 0));
827
828 if (offset >= m_used)
829 {
830 // data in cache
831 UCHAR* to = m_cache.begin();
832 to += (offset - m_used);
833 fb_assert(to < m_cache.end());
834 memcpy(to, data, dataSize);
835 }
836 else
837 {
838 if (offset + dataSize > m_used)
839 {
840 // what a pity - data appears partilly divided between cache & tempspace
841 fb_assert(offset + dataSize <= getSize());
842 flush();
843 }
844
845 const FB_UINT64 writtenBytes = m_space->write(offset, data, dataSize);
846 fb_assert(writtenBytes == dataSize);
847 }
848}
849
850void DsqlBatch::DataCache::put(const void* d, ULONG dataSize)
851{

Callers 1

blobSetSizeMethod · 0.80

Calls 3

beginMethod · 0.45
endMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected