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

Method storeToPage

src/jrd/blb.cpp:2993–3038  ·  view source on GitHub ↗

Used by DPM_store_blob

Source from the content-addressed store, hash-verified

2991
2992// Used by DPM_store_blob
2993void blb::storeToPage(USHORT* length, Firebird::Array<UCHAR>& buffer, const UCHAR** data, void* stack)
2994{
2995 if (blb_level == 0)
2996 {
2997 *length = blb_clump_size - blb_space_remaining;
2998
2999 if (!hasBuffer())
3000 {
3001 if (blb_temp_size > 0)
3002 {
3003 blb_transaction->getBlobSpace()->read(
3004 blb_temp_offset, buffer.getBuffer(blb_temp_size), blb_temp_size);
3005 *data = buffer.begin();
3006 }
3007 else
3008 {
3009 fb_assert(*length == 0);
3010 *data = NULL;
3011 }
3012 }
3013 else
3014 *data = getBuffer();
3015
3016 if (*data)
3017 *data = (UCHAR*) ((blob_page*) *data)->blp_page;
3018 }
3019 else
3020 {
3021 // CVC: Sorry, but I couldn't use PageStack in blb.h without bringing several headers,
3022 // so I resorted to void* for the param declaration.
3023 PageStack& stack2 = *static_cast<PageStack*>(stack);
3024 *length = static_cast<USHORT>(blb_pages->count() * sizeof(ULONG));
3025 *data = (UCHAR*) blb_pages->begin();
3026
3027 // Figure out precedence pages, if any
3028 // hvlad: no need to maintain precedence for temporary data
3029 if (!PageSpace::isTemporary(blb_pg_space_id))
3030 {
3031 vcl::const_iterator ptr, end;
3032 for (ptr = blb_pages->begin(), end = blb_pages->end(); ptr < end; ++ptr)
3033 {
3034 stack2.push(PageNumber(blb_pg_space_id, *ptr));
3035 }
3036 }
3037 }
3038}
3039
3040void blb::BLB_cancel()
3041{

Callers

nothing calls this directly

Calls 9

getBufferFunction · 0.85
getBlobSpaceMethod · 0.80
PageNumberClass · 0.70
readMethod · 0.45
getBufferMethod · 0.45
beginMethod · 0.45
countMethod · 0.45
endMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected