32 #ifndef _QORE_INTERN_THREADLOCALVARIABLEDATA_H
33 #define _QORE_INTERN_THREADLOCALVARIABLEDATA_H
35 class ThreadLocalVariableData :
public ThreadLocalData<LocalVarValue> {
39 ThreadLocalVariableData::iterator i(curr);
41 sdh.
deref(i.get().finalize());
50 while (curr->prev || curr->pos)
54 DLLLOCAL LocalVarValue* instantiate() {
55 if (curr->pos == QORE_THREAD_STACK_BLOCK) {
59 curr->next =
new Block(curr);
64 return &curr->var[curr->pos++];
68 uninstantiateIntern();
70 curr->var[curr->pos].uninstantiate(xsink);
73 DLLLOCAL
void uninstantiateSelf() {
74 uninstantiateIntern();
75 curr->var[curr->pos].uninstantiateSelf();
78 DLLLOCAL
void uninstantiateIntern() {
91 DLLLOCAL LocalVarValue* find(
const char*
id) {
97 LocalVarValue* var = &w->var[p];
98 if (var->id ==
id && !var->frame_boundary)
105 printd(0,
"ThreadLocalVariableData::find() this: %p no local variable '%s' (%p) on stack (pgm: %p) p: %d\n",
this,
id,
id,
getProgram(), p);
107 printd(0,
"var p: %d: %s (%p) (frame_boundary: %d)\n", p, curr->var[p].id, curr->var[p].id, curr->var[p].frame_boundary);
118 DLLLOCAL
void pushFrameBoundary() {
121 LocalVarValue* v = instantiate();
122 v->setFrameBoundary();
125 DLLLOCAL
void popFrameBoundary() {
126 assert(frame_count >= 0);
129 uninstantiateIntern();
130 assert(curr->var[curr->pos].frame_boundary);
131 curr->var[curr->pos].frame_boundary =
false;
134 DLLLOCAL
int getFrame(
int frame, Block*& w,
int& p);