mojoshader_preprocessor.c
changeset 1188 25000edc0176
parent 1182 179ffe99c57f
child 1195 f4ef8606c68d
--- a/mojoshader_preprocessor.c	Thu May 17 13:05:09 2018 -0400
+++ b/mojoshader_preprocessor.c	Wed May 23 11:07:59 2018 -0400
@@ -68,10 +68,9 @@
     ctx->out_of_memory = 1;
 } // out_of_memory
 
-static char zeromalloc = 0;
 static inline void *Malloc(Context *ctx, const size_t len)
 {
-    void *retval = (len == 0) ? &zeromalloc : ctx->malloc((int) len, ctx->malloc_data);
+    void *retval = ctx->malloc((int) len, ctx->malloc_data);
     if (retval == NULL)
         out_of_memory(ctx);
     return retval;
@@ -79,8 +78,7 @@
 
 static inline void Free(Context *ctx, void *ptr)
 {
-    if ((ptr != &zeromalloc) && (ptr != NULL))
-        ctx->free(ptr, ctx->malloc_data);
+    ctx->free(ptr, ctx->malloc_data);
 } // Free
 
 static void *MallocBridge(int bytes, void *data)