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

Function VIO_gc_record

src/jrd/vio.cpp:2875–2920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2873
2874
2875Record* VIO_gc_record(thread_db* tdbb, jrd_rel* relation)
2876{
2877/**************************************
2878 *
2879 * V I O _ g c _ r e c o r d
2880 *
2881 **************************************
2882 *
2883 * Functional description
2884 * Allocate from a relation's vector of garbage
2885 * collect record blocks. Their scope is strictly
2886 * limited to temporary usage and should never be
2887 * copied to permanent record parameter blocks.
2888 *
2889 **************************************/
2890 SET_TDBB(tdbb);
2891 Database* dbb = tdbb->getDatabase();
2892 CHECK_DBB(dbb);
2893
2894 const Format* const format = MET_current(tdbb, relation);
2895
2896 // Set the active flag on an inactive garbage collect record block and return it
2897
2898 for (Record** iter = relation->rel_gc_records.begin();
2899 iter != relation->rel_gc_records.end();
2900 ++iter)
2901 {
2902 Record* const record = *iter;
2903 fb_assert(record);
2904
2905 if (!record->isTempActive())
2906 {
2907 // initialize record for reuse
2908 record->reset(format);
2909 record->setTempActive();
2910 return record;
2911 }
2912 }
2913
2914 // Allocate a garbage collect record block if all are active
2915
2916 Record* const record = FB_NEW_POOL(*relation->rel_pool)
2917 Record(*relation->rel_pool, format, true);
2918 relation->rel_gc_records.add(record);
2919 return record;
2920}
2921
2922
2923bool VIO_get(thread_db* tdbb, record_param* rpb, jrd_tra* transaction, MemoryPool* pool)

Callers 6

VIO_backoutFunction · 0.85
VIO_modifyFunction · 0.85
purgeFunction · 0.85
VIO_update_in_placeFunction · 0.85
handlerMethod · 0.85
check_duplicatesFunction · 0.85

Calls 10

SET_TDBBFunction · 0.85
CHECK_DBBFunction · 0.85
getDatabaseMethod · 0.80
isTempActiveMethod · 0.80
setTempActiveMethod · 0.80
RecordClass · 0.70
beginMethod · 0.45
endMethod · 0.45
resetMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected