summaryrefslogtreecommitdiffhomepage
path: root/src/extmalloc.h
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-08-20 16:20:03 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2023-08-27 00:46:09 +0100
commita1998f2f7ce4153d670e2e5cb5018366517cc1ca (patch)
tree4d899fbad24c728c0b51f183c61ed6a7fb213c04 /src/extmalloc.h
parent38fa6c52a8a26ac178a3e1f80a8317740b8e82b3 (diff)
Get things at least compiling under Linux
Nothing really works yet, but at least test.h and fastspin are fixed and some of the issues with RTTI and libdl and stuff are maybe kind of sorted, subject to more testing later. The main issue now seems to be the cvar interface not quite lining up and crashing pretty much immediately. That'll probably take a lot more debugging to figure out, which likely still won't be a priority for quite a while.
Diffstat (limited to 'src/extmalloc.h')
-rw-r--r--src/extmalloc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/extmalloc.h b/src/extmalloc.h
index eb41730..6297360 100644
--- a/src/extmalloc.h
+++ b/src/extmalloc.h
@@ -23,10 +23,18 @@
* These functions are just like malloc/realloc/free, but they call into
* Valve's memory allocator wrapper, which ensures that allocations crossing
* plugin/engine boundaries won't cause any weird issues.
+ *
+ * On Linux, there is no allocation wrapper, but these still do their own OoM
+ * checking, so there's no need to think about that.
*/
void *extmalloc(usize sz);
void *extrealloc(void *mem, usize sz);
+#ifdef _WIN32
void extfree(void *mem);
+#else
+void free(void *);
+#define extfree free
+#endif
#endif