Skip to content
Permalink
Browse files
[svn] Fixed test malloc.
--HG--
branch : trunk
  • Loading branch information
icculus committed Mar 28, 2008
1 parent 5db00c6 commit e92cc011a4a87695d0fa6549e67a4da0f222b5d1
Showing with 3 additions and 4 deletions.
  1. +3 −4 testparse.c
@@ -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));
@@ -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

0 comments on commit e92cc01

Please sign in to comment.