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

Function PAR_context

src/jrd/par.cpp:824–868  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

822
823
824StreamType PAR_context(CompilerScratch* csb, SSHORT* context_ptr)
825{
826/**************************************
827 *
828 * P A R _ c o n t e x t
829 *
830 **************************************
831 *
832 * Functional description
833 * Introduce a new context into the system. This involves
834 * assigning a stream and possibly extending the compile
835 * scratch block.
836 *
837 **************************************/
838
839 // CVC: Bottleneck
840 const SSHORT context = (unsigned int) csb->csb_blr_reader.getByte();
841
842 if (context_ptr)
843 *context_ptr = context;
844
845 CompilerScratch::csb_repeat* tail = CMP_csb_element(csb, context);
846
847 if (tail->csb_flags & csb_used)
848 {
849 if (csb->csb_g_flags & csb_reuse_context) {
850 return tail->csb_stream;
851 }
852
853 PAR_error(csb, Arg::Gds(isc_ctxinuse));
854 }
855
856 const StreamType stream = csb->nextStream(false);
857 if (stream >= MAX_STREAMS)
858 {
859 PAR_error(csb, Arg::Gds(isc_too_many_contexts));
860 }
861
862 tail->csb_flags |= csb_used;
863 tail->csb_stream = stream;
864
865 CMP_csb_element(csb, stream);
866
867 return stream;
868}
869
870
871void PAR_dependency(thread_db* tdbb, CompilerScratch* csb, StreamType stream, SSHORT id,

Callers 3

parseMethod · 0.85
parseWindowMethod · 0.85

Calls 5

CMP_csb_elementFunction · 0.85
GdsClass · 0.85
nextStreamMethod · 0.80
PAR_errorFunction · 0.70
getByteMethod · 0.45

Tested by

no test coverage detected