Skip to content

Commit

Permalink
Allow internal dependency on malloc/free to be #ifdef'd out.
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 25, 2008
1 parent b3acf5b commit 42646a0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mojoshader.c
Expand Up @@ -4323,9 +4323,15 @@ static int parse_token(Context *ctx)
} // 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)
{
Expand Down

0 comments on commit 42646a0

Please sign in to comment.