Ignore:
Timestamp:
Mar 22, 2008, 10:39:25 AM (14 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/sdlport/sound.cpp

    r124 r129  
    2323
    2424#include "sound.hpp"
    25 #include "jmalloc.hpp"
    2625#include "readwav.hpp"
    2726#include "specs.hpp"
     
    127126    // Check for the sfx directory, disable sound if we can't find it.
    128127    datadir = get_filename_prefix();
    129     sfxdir = (char *)jmalloc( strlen( datadir ) + 5 + 1, "sfxdir" );
     128    sfxdir = (char *)malloc( strlen( datadir ) + 5 + 1 );
    130129    sprintf( sfxdir, "%s/sfx/", datadir );
    131130    if( (fd = fopen( sfxdir,"r" )) == NULL )
     
    135134        return 0;
    136135    }
    137     jfree( sfxdir );
     136    free( sfxdir );
    138137
    139138    audioWanted.freq = 11025;
     
    174173            effect_handle *last = fx_list;
    175174            fx_list = fx_list->next;
    176             jfree( last );
     175            free( last );
    177176        }
    178177        SDL_CloseAudio();
     
    205204        if( data )
    206205        {
    207             jfree( data );
     206            free( data );
    208207        }
    209208    }
     
    296295{
    297296    data = NULL;
    298     Name = strcpy((char *)jmalloc( strlen( filename ) + 1, "song name" ), filename );
     297    Name = strcpy((char *)malloc( strlen( filename ) + 1 ), filename );
    299298    song_id = 0;
    300299}
     
    308307    if( data )
    309308    {
    310         jfree( data );
    311     }
    312     jfree( Name );
     309        free( data );
     310    }
     311    free( Name );
    313312}
    314313
Note: See TracChangeset for help on using the changeset viewer.