Skip to content

Commit

Permalink
Minor tweaks to Malloc() and Free() convenience functions.
Browse files Browse the repository at this point in the history
Smushed in a comment, constified some things.

--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 12, 2008
1 parent e9c9395 commit c8b85c1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mojoshader.c
Expand Up @@ -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

Expand Down

0 comments on commit c8b85c1

Please sign in to comment.