summaryrefslogtreecommitdiff
path: root/lume-legacy/src/ulib/cxx.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lume-legacy/src/ulib/cxx.cc')
-rw-r--r--lume-legacy/src/ulib/cxx.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/lume-legacy/src/ulib/cxx.cc b/lume-legacy/src/ulib/cxx.cc
new file mode 100644
index 0000000..d8f510d
--- /dev/null
+++ b/lume-legacy/src/ulib/cxx.cc
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2026 Richard QIn
+ */
+#include "ulib/stdlib.h"
+
+void *operator new(unsigned long n)
+{
+ return malloc(n);
+}
+
+void *operator new[](unsigned long n)
+{
+ return malloc(n);
+}
+
+void operator delete(void *p)
+{
+ free(p);
+}
+
+void operator delete[](void *p)
+{
+ free(p);
+}
+
+void operator delete(void *p, unsigned long)
+{
+ free(p);
+}
+
+void operator delete[](void *p, unsigned long)
+{
+ free(p);
+} \ No newline at end of file