Solid Fluid System Solutions  
Home Software About Hardware Firmware
Document Icon LibJPEG
Current Document Icon Modifications
Document Icon Mods - jbufferdst.cpp
Document Icon Mods - jbuffersrc.cpp
Document Icon ToJPEG
Document Icon FromJPEG

Modifications made to the LibJPEG library

The prototypes for memory allocation in the LibJPEG library were mentioned as being modified;

GLOBAL(void *) jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject);
GLOBAL(void) jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject);
GLOBAL(void FAR *) jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject);
GLOBAL(void) jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject);

jmemnobs.cpp

The following function excerpts have been taken from jmemnobs.cpp, where modifications are marked "//here"

/*
 * Memory allocation and freeing are controlled by the regular library
 * routines malloc() and free().
 */

GLOBAL(void *)
jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
{
  return (void *) img_malloc(sizeofobject);						//here
}

GLOBAL(void)
jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
{
  img_free(object);												//here
}


/*
 * "Large" objects are treated the same as "small" ones.
 * NB: although we include FAR keywords in the routine declarations,
 * this file won't actually work in 80x86 small/medium model; at least,
 * you probably won't be able to process useful-size images in only 64KB.
 */

GLOBAL(void FAR *)
jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
{
  return (void FAR *) img_malloc(sizeofobject);					//here
}

GLOBAL(void)
jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
{
  img_free(object);												//here
}
Copyright © Solid Fluid 2007-2022
Last modified: SolFlu  Mon, 15 Jun 2009 09:22:22 GMT