summaryrefslogtreecommitdiffhomepage
path: root/CRTKit
diff options
context:
space:
mode:
Diffstat (limited to 'CRTKit')
-rw-r--r--CRTKit/README.md5
-rw-r--r--CRTKit/ReadMe.md5
-rw-r--r--CRTKit/__mpcc_runtime.cxx12
-rw-r--r--CRTKit/__ndk_alloca.hxx (renamed from CRTKit/__mpcc_alloca.hxx)2
-rw-r--r--CRTKit/__ndk_defines.hxx (renamed from CRTKit/__mpcc_defines.hxx)10
-rw-r--r--CRTKit/__ndk_exception.hxx (renamed from CRTKit/__mpcc_exception.hxx)2
-rw-r--r--CRTKit/__ndk_new_delete.hxx (renamed from CRTKit/__mpcc_malloc.hxx)38
-rw-r--r--CRTKit/__ndk_runtime.cxx11
8 files changed, 58 insertions, 27 deletions
diff --git a/CRTKit/README.md b/CRTKit/README.md
deleted file mode 100644
index c7058527..00000000
--- a/CRTKit/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# ZKA C++ RunTime
-
-This is the public interface of ZKA' RT, please check libNDK.dll instead.
-
-###### (c) ZKA Technologies, all rights reserved. \ No newline at end of file
diff --git a/CRTKit/ReadMe.md b/CRTKit/ReadMe.md
new file mode 100644
index 00000000..25dc2cb2
--- /dev/null
+++ b/CRTKit/ReadMe.md
@@ -0,0 +1,5 @@
+# ZKA C++ RunTime
+
+This is the public interface of ZKA' NDK RunTime, please check ndk.dll instead.
+
+###### (c) ZKA Technologies, all rights reserved. \ No newline at end of file
diff --git a/CRTKit/__mpcc_runtime.cxx b/CRTKit/__mpcc_runtime.cxx
deleted file mode 100644
index 639b2ca2..00000000
--- a/CRTKit/__mpcc_runtime.cxx
+++ /dev/null
@@ -1,12 +0,0 @@
-/* -------------------------------------------
-
- Copyright ZKA Technologies
-
-------------------------------------------- */
-
-#include <CRTKit/__mpcc_alloca.hxx>
-#include <CRTKit/__mpcc_defines.hxx>
-#include <CRTKit/__mpcc_malloc.hxx>
-#include <CRTKit/__mpcc_exception.hxx>
-
-/// @note No sources needed for now. \ No newline at end of file
diff --git a/CRTKit/__mpcc_alloca.hxx b/CRTKit/__ndk_alloca.hxx
index cc123ac5..126beadd 100644
--- a/CRTKit/__mpcc_alloca.hxx
+++ b/CRTKit/__ndk_alloca.hxx
@@ -9,7 +9,7 @@
typedef void* ptr_type;
typedef __SIZE_TYPE__ size_type;
-inline void* __mpcc_alloca(size_type sz)
+inline void* __ndk_alloca(size_type sz)
{
return __builtin_alloca(sz);
}
diff --git a/CRTKit/__mpcc_defines.hxx b/CRTKit/__ndk_defines.hxx
index 3047ef2b..db9d3fe5 100644
--- a/CRTKit/__mpcc_defines.hxx
+++ b/CRTKit/__ndk_defines.hxx
@@ -28,11 +28,11 @@ typedef char* caddr_t;
#endif // !null
#ifdef __GNUC__
-#include <CRT/__mpcc_alloca.hxx>
-#define __mpcc_alloca(sz) __mpcc_alloca(sz)
+#include <CRT/__ndk_alloca.hxx>
+#define __ndk_alloca(sz) __ndk_alloca(sz)
#elif defined(__NDK__)
-#define __alloca(sz) __mpcc_alloca(sz)
+#define __alloca(sz) __ndk_alloca(sz)
#endif
#define __deref(ptr) (*(ptr))
@@ -90,8 +90,8 @@ typedef union double_cast {
#ifdef __STD_CXX__
-#include <CRT/__mpcc_exception.hxx>
-#include <CRT/__mpcc_malloc.hxx>
+#include <CRT/__ndk_exception.hxx>
+#include <CRT/__ndk_malloc.hxx>
#endif // ifdef __STD_CXX__
diff --git a/CRTKit/__mpcc_exception.hxx b/CRTKit/__ndk_exception.hxx
index e9e98996..14340304 100644
--- a/CRTKit/__mpcc_exception.hxx
+++ b/CRTKit/__ndk_exception.hxx
@@ -6,7 +6,7 @@
#pragma once
-#include <CRTKit/__mpcc_defines.hxx>
+#include <CRTKit/__ndk_defines.hxx>
/// @brief CRT exit, with exit code (!!! exits all threads. !!!)
/// @param code
diff --git a/CRTKit/__mpcc_malloc.hxx b/CRTKit/__ndk_new_delete.hxx
index 794cd5b4..9edf7ef4 100644
--- a/CRTKit/__mpcc_malloc.hxx
+++ b/CRTKit/__ndk_new_delete.hxx
@@ -6,7 +6,8 @@
#pragma once
-#include <CRTKit/__mpcc_defines.hxx>
+#include <CRTKit/__ndk_defines.hxx>
+#include <SCIKit/SCIBase.hxx>
namespace stdx
{
@@ -23,8 +24,39 @@ namespace stdx
template <typename KindClass>
inline void release(KindClass ptr)
{
- if (!ptr)
- return;
delete ptr;
}
} // namespace stdx
+
+void* operator new(size_type len)
+{
+ if (!len)
+ ++len;
+
+ return RtlCreateHeap(len, 0);
+}
+
+void operator delete(void* ptr)
+{
+ if (!ptr)
+ return;
+
+
+ RtlDestroyHeap(ptr);
+}
+
+void* operator new[](size_type len)
+{
+ if (!len)
+ ++len;
+
+ return RtlCreateHeap(len, 0);
+}
+
+void operator delete[](void* ptr)
+{
+ if (!ptr)
+ return;
+
+ RtlDestroyHeap(ptr);
+} \ No newline at end of file
diff --git a/CRTKit/__ndk_runtime.cxx b/CRTKit/__ndk_runtime.cxx
new file mode 100644
index 00000000..d912adc9
--- /dev/null
+++ b/CRTKit/__ndk_runtime.cxx
@@ -0,0 +1,11 @@
+/* -------------------------------------------
+
+ Copyright ZKA Technologies
+
+------------------------------------------- */
+
+#include <CRTKit/__ndk_alloca.hxx>
+#include <CRTKit/__ndk_defines.hxx>
+#include <CRTKit/__ndk_exception.hxx>
+
+/// @note No sources needed for now. \ No newline at end of file