Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[svn] Fixed test malloc.
--HG--
branch : trunk
  • Loading branch information
icculus committed Mar 28, 2008
1 parent 5db00c6 commit e92cc01
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions testparse.c
Expand Up @@ -3,7 +3,7 @@
#include "mojoshader.h"


#if DEBUG_MALLOC
#if MOJOSHADER_DEBUG_MALLOC
static void *Malloc(int len)
{
void *ptr = malloc(len + sizeof (int));
Expand All @@ -17,9 +17,8 @@ static void *Malloc(int len)

static void Free(void *_ptr)
{
int *ptr = (((int *) ptr) - 1);
int *store = (int *) ptr;
int len = *store;
int *ptr = (((int *) _ptr) - 1);
int len = *ptr;
printf("free() %d bytes (%p)\n", len, ptr);
free(ptr);
} // Free
Expand Down

0 comments on commit e92cc01

Please sign in to comment.