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/imlib/filter.cpp

    r128 r129  
    1919{
    2020  nc=from->pal_size() > to->pal_size() ? from->pal_size() : to->pal_size();
    21   unsigned char *p=fdat=(unsigned char *)jmalloc(nc,"conversion filter");
     21  unsigned char *p=fdat=(unsigned char *)malloc(nc);
    2222  unsigned char *r,*g,*b;
    2323  r=g=b=(unsigned char *)from->addr();
     
    7373  nc=colors;
    7474  make_block(nc);
    75   fdat=(unsigned char *)jmalloc(nc,"filter");
     75  fdat=(unsigned char *)malloc(nc);
    7676  clear();
    7777}
     
    121121  long dist_sqr,best;
    122122  int colors=1<<color_bits;
    123   color_table=(unsigned char *)jmalloc(colors*colors*colors,"color_filter");
     123  color_table=(unsigned char *)malloc(colors*colors*colors);
    124124  for (r=0;r<colors;r++)
    125125  {
     
    156156  fp->read_uint16();
    157157  int colors=32;
    158   color_table=(unsigned char *)jmalloc(colors*colors*colors,"color_filter : loaded");
     158  color_table=(unsigned char *)malloc(colors*colors*colors);
    159159  fp->read(color_table,colors*colors*colors);
    160160}
Note: See TracChangeset for help on using the changeset viewer.