Allow internal dependency on malloc/free to be #ifdef'd out. trunk
authorRyan C. Gordon <icculus@icculus.org>
Fri, 25 Apr 2008 14:37:08 -0400
branchtrunk
changeset 195 5e68c48dac00
parent 194 8de489efc811
child 196 5715754e5549
Allow internal dependency on malloc/free to be #ifdef'd out.
mojoshader.c
--- a/mojoshader.c	Fri Apr 25 05:29:36 2008 -0400
+++ b/mojoshader.c	Fri Apr 25 14:37:08 2008 -0400
@@ -4323,9 +4323,15 @@
 } // parse_token
 
 
+// #define this to force app to supply an allocator, so there's no reference
+//  to the C runtime's malloc() and free()...
+#if MOJOSHADER_FORCE_ALLOCATOR
+#define internal_malloc NULL
+#define internal_free NULL
+#else
 static void *internal_malloc(int bytes, void *d) { return malloc(bytes); }
 static void internal_free(void *ptr, void *d) { free(ptr); }
-
+#endif
 
 static int find_profile_id(const char *profile)
 {