Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
CallContext.cxx
Go to the documentation of this file.
1// Bindings
2#include "cpyrt.h"
3
4using namespace cppjit;
5#include "CallContext.h"
6
7//-----------------------------------------------------------------------------
9 static uint32_t flags = 0;
10 return flags;
11}
12
13//-----------------------------------------------------------------------------
15 if (pyobj) {
16 if (!fTemps)
17 fTemps = new Temporary{pyobj, nullptr};
18 else {
19 Temporary* tmp = fTemps;
20 while (tmp->fNext)
21 tmp = tmp->fNext;
22 tmp->fNext = new Temporary{pyobj, nullptr};
23 }
24 }
25}
26
27//-----------------------------------------------------------------------------
29 Temporary* tmp = fTemps;
30 while (tmp) {
31 Py_DECREF(tmp->fPyObject);
32 Temporary* tmp2 = tmp->fNext;
33 delete tmp;
34 tmp = tmp2;
35 }
36 fTemps = nullptr;
37}
38
39//-----------------------------------------------------------------------------
40bool cpyrt::CallContext::SetGlobalPolicy(ECallFlags toggleFlag, bool enabled) {
41 auto& flags = GlobalPolicyFlags();
42 bool old = flags & toggleFlag;
43 if (enabled)
44 flags |= toggleFlag;
45 else
46 flags &= ~toggleFlag;
47 return old;
48}
_object PyObject
Definition API.cxx:34
static bool SetGlobalPolicy(ECallFlags e, bool enabled)
void AddTemporary(PyObject *pyobj)
static uint32_t & GlobalPolicyFlags()