Minor tweaks to Malloc() and Free() convenience functions. trunk
authorRyan C. Gordon <icculus@icculus.org>
Sat, 12 Apr 2008 16:51:23 -0400
branchtrunk
changeset 126 556779e8a6d7
parent 125 9d7952ff149d
child 127 08ed4307aeea
Minor tweaks to Malloc() and Free() convenience functions. Smushed in a comment, constified some things.
mojoshader.c
--- a/mojoshader.c	Mon Apr 07 20:06:27 2008 -0400
+++ b/mojoshader.c	Sat Apr 12 16:51:23 2008 -0400
@@ -340,16 +340,15 @@
 
 // Convenience functions for allocators...
 
-static inline void *Malloc(Context *ctx, int len)
+static inline void *Malloc(const Context *ctx, const int len)
 {
     return ctx->malloc(len, ctx->malloc_data);
 } // Malloc
 
 
-static inline void Free(Context *ctx, void *ptr)
-{
-    // check for NULL in case of dumb free() impl.
-    if (ptr != NULL)
+static inline void Free(const Context *ctx, void *ptr)
+{
+    if (ptr != NULL)  // check for NULL in case of dumb free() impl.
         ctx->free(ptr, ctx->malloc_data);
 } // Free