Ignore:
Timestamp:
Mar 22, 2008, 10:39:25 AM (15 years ago)
Author:
Sam Hocevar
Message:
  • Get rid of jmalloc and replace it with standard malloc. Modern operating systems certainly perform a lot better than this custom implementation, and we have superior tools (eg. valgrind) to debug and profile memory usage without interfering with the code itself.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/objects.cpp

    r126 r129  
    341341game_object::~game_object()
    342342{
    343   if (lvars) jfree(lvars);
     343  if (lvars) free(lvars);
    344344  clean_up();
    345345}
     
    15631563    if (t)
    15641564    {
    1565       lvars=(int32_t *)jmalloc(t*4,"object vars");
     1565      lvars=(int32_t *)malloc(t * 4);
    15661566      memset(lvars,0,t*4);
    15671567    }
     
    16201620void game_object::change_type(int new_type)
    16211621{
    1622   if (lvars) jfree(lvars);     // free old variable
     1622  if (lvars) free(lvars);     // free old variable
    16231623
    16241624  if (otype<0xffff)
     
    16271627    if (t)
    16281628    {
    1629       lvars=(int32_t *)jmalloc(t*4,"object vars");
     1629      lvars=(int32_t *)malloc(t*4);
    16301630      memset(lvars,0,t*4);
    16311631    }
Note: See TracChangeset for help on using the changeset viewer.