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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
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
Hide 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,
UpgradeStartup
::
installEXEC
(
this
);
CLEAR_ERROR_INSERT_VALUE
;
#ifdef VM_TRACE
m_global_variables
=
new
Ptr
<
void
>
*
[
1
];
m_global_variables
[
0
]
=
0
;
#endif
}
SimulatedBlock
::~
SimulatedBlock
()
...
...
@@ -112,6 +117,10 @@ SimulatedBlock::~SimulatedBlock()
#ifdef VM_TRACE_TIME
printTimes
(
stdout
);
#endif
#ifdef VM_TRACE
delete
[]
m_global_variables
;
#endif
}
void
...
...
@@ -1771,3 +1780,25 @@ SimulatedBlock::execUPGRADE(Signal* signal){
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:
* Handling of execFunctions
*/
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
();
ExecFunction
theExecArray
[
MAX_GSN
+
1
];
public:
...
...
@@ -447,6 +447,12 @@ public:
}
m_timeTrace
[
MAX_GSN
+
1
];
Uint32
m_currentGsn
;
#endif
#ifdef VM_TRACE
Ptr
<
void
>
**
m_global_variables
;
void
clear_global_variables
();
void
init_globals_list
(
void
**
tmp
,
size_t
cnt
);
#endif
};
inline
...
...
@@ -454,6 +460,9 @@ void
SimulatedBlock
::
executeFunction
(
GlobalSignalNumber
gsn
,
Signal
*
signal
){
ExecFunction
f
=
theExecArray
[
gsn
];
if
(
gsn
<=
MAX_GSN
&&
f
!=
0
){
#ifdef VM_TRACE
clear_global_variables
();
#endif
(
this
->*
f
)(
signal
);
return
;
}
...
...
@@ -679,6 +688,5 @@ BLOCK::addRecSignal(GlobalSignalNumber gsn, ExecSignalLocal f, bool force){ \
addRecSignalImpl(gsn, (ExecFunction)f, force);\
}
#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