Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
73e15672
Commit
73e15672
authored
Aug 13, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduced system for automatic clearing of block global variables (VM_TRACE'd)
parent
3fdc2999
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
ndb/src/kernel/vm/SimulatedBlock.cpp
ndb/src/kernel/vm/SimulatedBlock.cpp
+31
-0
ndb/src/kernel/vm/SimulatedBlock.hpp
ndb/src/kernel/vm/SimulatedBlock.hpp
+10
-2
No files found.
ndb/src/kernel/vm/SimulatedBlock.cpp
View file @
73e15672
...
@@ -104,6 +104,11 @@ SimulatedBlock::SimulatedBlock(BlockNumber blockNumber,
...
@@ -104,6 +104,11 @@ SimulatedBlock::SimulatedBlock(BlockNumber blockNumber,
UpgradeStartup
::
installEXEC
(
this
);
UpgradeStartup
::
installEXEC
(
this
);
CLEAR_ERROR_INSERT_VALUE
;
CLEAR_ERROR_INSERT_VALUE
;
#ifdef VM_TRACE
m_global_variables
=
new
Ptr
<
void
>
*
[
1
];
m_global_variables
[
0
]
=
0
;
#endif
}
}
SimulatedBlock
::~
SimulatedBlock
()
SimulatedBlock
::~
SimulatedBlock
()
...
@@ -112,6 +117,10 @@ SimulatedBlock::~SimulatedBlock()
...
@@ -112,6 +117,10 @@ SimulatedBlock::~SimulatedBlock()
#ifdef VM_TRACE_TIME
#ifdef VM_TRACE_TIME
printTimes
(
stdout
);
printTimes
(
stdout
);
#endif
#endif
#ifdef VM_TRACE
delete
[]
m_global_variables
;
#endif
}
}
void
void
...
@@ -1771,3 +1780,25 @@ SimulatedBlock::execUPGRADE(Signal* signal){
...
@@ -1771,3 +1780,25 @@ SimulatedBlock::execUPGRADE(Signal* signal){
break
;
break
;
}
}
}
}
#ifdef VM_TRACE
void
SimulatedBlock
::
clear_global_variables
(){
Ptr
<
void
>
**
tmp
=
m_global_variables
;
while
(
*
tmp
!=
0
){
(
*
tmp
)
->
i
=
RNIL
;
(
*
tmp
)
->
p
=
0
;
tmp
++
;
}
}
void
SimulatedBlock
::
init_globals_list
(
void
**
tmp
,
size_t
cnt
){
m_global_variables
=
new
Ptr
<
void
>
*
[
cnt
+
1
];
for
(
size_t
i
=
0
;
i
<
cnt
;
i
++
){
m_global_variables
[
i
]
=
(
Ptr
<
void
>*
)
tmp
[
i
];
}
m_global_variables
[
cnt
]
=
0
;
}
#endif
ndb/src/kernel/vm/SimulatedBlock.hpp
View file @
73e15672
...
@@ -96,7 +96,7 @@ protected:
...
@@ -96,7 +96,7 @@ protected:
* Handling of execFunctions
* Handling of execFunctions
*/
*/
typedef
void
(
SimulatedBlock
::*
ExecFunction
)(
Signal
*
signal
);
typedef
void
(
SimulatedBlock
::*
ExecFunction
)(
Signal
*
signal
);
void
addRecSignalImpl
(
GlobalSignalNumber
g
,
ExecFunction
fun
,
bool
f
=
false
);
void
addRecSignalImpl
(
GlobalSignalNumber
g
,
ExecFunction
fun
,
bool
f
=
false
);
void
installSimulatedBlockFunctions
();
void
installSimulatedBlockFunctions
();
ExecFunction
theExecArray
[
MAX_GSN
+
1
];
ExecFunction
theExecArray
[
MAX_GSN
+
1
];
public:
public:
...
@@ -447,6 +447,12 @@ public:
...
@@ -447,6 +447,12 @@ public:
}
m_timeTrace
[
MAX_GSN
+
1
];
}
m_timeTrace
[
MAX_GSN
+
1
];
Uint32
m_currentGsn
;
Uint32
m_currentGsn
;
#endif
#endif
#ifdef VM_TRACE
Ptr
<
void
>
**
m_global_variables
;
void
clear_global_variables
();
void
init_globals_list
(
void
**
tmp
,
size_t
cnt
);
#endif
};
};
inline
inline
...
@@ -454,6 +460,9 @@ void
...
@@ -454,6 +460,9 @@ void
SimulatedBlock
::
executeFunction
(
GlobalSignalNumber
gsn
,
Signal
*
signal
){
SimulatedBlock
::
executeFunction
(
GlobalSignalNumber
gsn
,
Signal
*
signal
){
ExecFunction
f
=
theExecArray
[
gsn
];
ExecFunction
f
=
theExecArray
[
gsn
];
if
(
gsn
<=
MAX_GSN
&&
f
!=
0
){
if
(
gsn
<=
MAX_GSN
&&
f
!=
0
){
#ifdef VM_TRACE
clear_global_variables
();
#endif
(
this
->*
f
)(
signal
);
(
this
->*
f
)(
signal
);
return
;
return
;
}
}
...
@@ -679,6 +688,5 @@ BLOCK::addRecSignal(GlobalSignalNumber gsn, ExecSignalLocal f, bool force){ \
...
@@ -679,6 +688,5 @@ BLOCK::addRecSignal(GlobalSignalNumber gsn, ExecSignalLocal f, bool force){ \
addRecSignalImpl(gsn, (ExecFunction)f, force);\
addRecSignalImpl(gsn, (ExecFunction)f, force);\
}
}
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment