aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/qregisters.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2016-11-22 16:16:58 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2016-11-22 18:15:21 +0100
commit0bf380ff110897d2b5db2e22ef6efe1e9ba9888d (patch)
tree038f9aaac800097a630564a7465f0255cbb19df0 /src/qregisters.cpp
parentdd6410b2b35a76de75622660cae9c1444b7a1880 (diff)
downloadsciteco-0bf380ff110897d2b5db2e22ef6efe1e9ba9888d.tar.gz
fixed local Q-Register management on certain broken platforms
* on MSVCRT/MinGW, space allocated with alloca()/g_newa() was apparently freed once the first exception was caught. This prevented the proper destruction of local Q-Reg tables and broke the Windows port. * Since all alternatives to alloca() like VLAs are not practical, the default Q-Register initialization has been moved out of the QRegisterTable constructor into QRegisterTable::insert_defaults(). * The remaining QRegisterTable initialization and destruction is very cheap, so we simply reserve an empty QRegisterTable for local registers on every Execute::macro() call. The default registers are only initialized when required, though. * All of this has to change anyway once we replace the C++ call-stack approach to macro calls with our own macro call frame memory management.
Diffstat (limited to 'src/qregisters.cpp')
-rw-r--r--src/qregisters.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qregisters.cpp b/src/qregisters.cpp
index 80675be..19590c9 100644
--- a/src/qregisters.cpp
+++ b/src/qregisters.cpp
@@ -696,7 +696,8 @@ QRegisterClipboard::undo_exchange_string(QRegisterData &reg)
reg.undo_set_string();
}
-QRegisterTable::QRegisterTable(bool _undo) : must_undo(_undo)
+void
+QRegisterTable::insert_defaults(void)
{
/* general purpose registers */
for (gchar q = 'A'; q <= 'Z'; q++)