Skip to content
Permalink
Browse files
Minor tweaks to Malloc() and Free() convenience functions.
Smushed in a comment, constified some things.

--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 12, 2008
1 parent e9c9395 commit c8b85c14b2cf0f6e9b40a8b961e87f98bf17300b
Showing with 3 additions and 4 deletions.
  1. +3 −4 mojoshader.c
@@ -340,16 +340,15 @@ struct Context

// 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)
static inline void Free(const Context *ctx, void *ptr)
{
// check for NULL in case of dumb free() impl.
if (ptr != NULL)
if (ptr != NULL) // check for NULL in case of dumb free() impl.
ctx->free(ptr, ctx->malloc_data);
} // Free

0 comments on commit c8b85c1

Please sign in to comment.