summaryrefslogtreecommitdiff
path: root/init_global_static_roots.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'init_global_static_roots.cpp')
-rw-r--r--init_global_static_roots.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/init_global_static_roots.cpp b/init_global_static_roots.cpp
new file mode 100644
index 0000000..a39b380
--- /dev/null
+++ b/init_global_static_roots.cpp
@@ -0,0 +1,36 @@
+
+// INCLUDE FILES
+#include <e32def.h>
+
+#include <gc.h>
+#include <gcconfig.h>
+
+#include "init_global_static_roots.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+void init_global_static_roots()
+{
+ ptr_t dataStart = NULL;
+ ptr_t dataEnd = NULL;
+ #if defined (__WINS__)
+ extern int winscw_data_start, winscw_data_end;
+ dataStart = ((ptr_t)&winscw_data_start);
+ dataEnd = ((ptr_t)&winscw_data_end);
+ #else
+ extern int Image$$RW$$Limit[], Image$$RW$$Base[];
+ dataStart = ((ptr_t)Image$$RW$$Base);
+ dataEnd = ((ptr_t)Image$$RW$$Limit);
+ #endif //__WINS__
+
+ GC_add_roots(dataStart, dataEnd);
+
+}
+
+
+#ifdef __cplusplus
+ }
+#endif