MCPcopy Create free account
hub / github.com/beefytech/Beef / AllocContext

Method AllocContext

IDEHelper/Compiler/CeMachine.cpp:10689–10713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10687}
10688
10689CeContext* CeMachine::AllocContext()
10690{
10691 CeContext* ceContext = NULL;
10692 if (!mContextList.IsEmpty())
10693 {
10694 ceContext = mContextList.back();
10695 mContextList.pop_back();
10696 }
10697 else
10698 {
10699 ceContext = new CeContext();
10700 ceContext->mCeMachine = this;
10701 ceContext->mMemory.Reserve(BF_CE_INITIAL_MEMORY);
10702 memset(ceContext->mMemory.mVals, 0, BF_CE_INITIAL_MEMORY);
10703 }
10704
10705 ceContext->mCurEmitContext = mCurEmitContext;
10706 mCurEmitContext = NULL;
10707 mExecuteId++;
10708 ceContext->mStackSize = BF_CE_DEFAULT_STACK_SIZE;
10709 ceContext->mMemory.ResizeRaw(ceContext->mStackSize);
10710 ceContext->mExecuteId = mExecuteId;
10711 ceContext->mCurHandleId = 0;
10712 return ceContext;
10713}
10714
10715void CeMachine::ReleaseContext(CeContext* ceContext)
10716{

Callers 3

HandleCEAttributesMethod · 0.80
DoCEEmitMethod · 0.80
GetCustomAttributeMethod · 0.80

Calls 5

IsEmptyMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45
ReserveMethod · 0.45
ResizeRawMethod · 0.45

Tested by

no test coverage detected