Atmel Software Framework

jmemmgr.c File Reference
#include "jinclude.h"
#include "jpeglib.h"
#include "jmemsys.h"

Data Structures

struct  jvirt_barray_control
 
struct  jvirt_sarray_control
 
union  large_pool_struct
 
struct  my_memory_mgr
 
union  small_pool_struct
 

Macros

#define ALIGN_TYPE   double
 
#define AM_MEMORY_MANAGER   /* we define jvirt_Xarray_control structs */
 
#define JPEG_INTERNALS
 
#define MIN_SLOP   50 /* greater than 0 to avoid futile looping */
 

Typedefs

typedef union large_pool_struct large_pool_hdr
 
typedef union
large_pool_struct FAR
large_pool_ptr
 
typedef my_memory_mgrmy_mem_ptr
 
typedef union small_pool_struct small_pool_hdr
 
typedef union small_pool_structsmall_pool_ptr
 

Functions

 access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, boolean writable)
 
 access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, boolean writable)
 
 alloc_barray (j_common_ptr cinfo, int pool_id, JDIMENSION blocksperrow, JDIMENSION numrows)
 
 alloc_sarray (j_common_ptr cinfo, int pool_id, JDIMENSION samplesperrow, JDIMENSION numrows)
 
 for (sptr=mem->virt_sarray_list;sptr!=NULL;sptr=sptr->next)
 
 for (bptr=mem->virt_barray_list;bptr!=NULL;bptr=bptr->next)
 
 for (i=0;i< (long) ptr->rows_in_mem;i+=ptr->rowsperchunk)
 
 free_pool (j_common_ptr cinfo, int pool_id)
 
 if (sizeofobject,(size_t)(MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr)))
 
 if (hdr_ptr==NULL)
 
 jinit_memory_mgr (j_common_ptr cinfo)
 
 request_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero, JDIMENSION blocksperrow, JDIMENSION numrows, JDIMENSION maxaccess)
 
 request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero, JDIMENSION samplesperrow, JDIMENSION numrows, JDIMENSION maxaccess)
 
 return (void *)
 
 self_destruct (j_common_ptr cinfo)
 

Variables

long avail_mem
 
jvirt_barray_ptr bptr
 
hdr_ptr hdr bytes_left = sizeofobject
 
hdr_ptr hdr bytes_used = sizeofobject
 
 bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE)
 
char * data_ptr = (char *) (hdr_ptr + 1)
 
 else
 
static const size_t extra_pool_slop [JPOOL_NUMPOOLS]
 
 file_offset = ptr->cur_start_row * bytesperrow
 
static const size_t first_pool_slop [JPOOL_NUMPOOLS]
 
small_pool_ptr hdr_ptr
 
long max_minheights = 1000000000L
 
long maximum_space = 0
 
size_t min_request
 
long minheights
 
size_t odd_bytes
 
small_pool_ptr prev_hdr_ptr
 
 return
 
size_t slop
 
long space_per_minheight
 
jvirt_sarray_ptr sptr
 

#define ALIGN_TYPE   double

Referenced by jinit_memory_mgr().

#define AM_MEMORY_MANAGER   /* we define jvirt_Xarray_control structs */
#define JPEG_INTERNALS
#define MIN_SLOP   50 /* greater than 0 to avoid futile looping */

Referenced by if().

access_virt_barray ( j_common_ptr  cinfo,
jvirt_barray_ptr  ptr,
JDIMENSION  start_row,
JDIMENSION  num_rows,
boolean  writable 
)

References ERREXIT, FALSE, FAR, NULL, num_rows, SIZEOF, and TRUE.

Referenced by jinit_memory_mgr().

access_virt_sarray ( j_common_ptr  cinfo,
jvirt_sarray_ptr  ptr,
JDIMENSION  start_row,
JDIMENSION  num_rows,
boolean  writable 
)

References ERREXIT, FALSE, FAR, NULL, num_rows, SIZEOF, and TRUE.

Referenced by jinit_memory_mgr().

alloc_barray ( j_common_ptr  cinfo,
int  pool_id,
JDIMENSION  blocksperrow,
JDIMENSION  numrows 
)
alloc_sarray ( j_common_ptr  cinfo,
int  pool_id,
JDIMENSION  samplesperrow,
JDIMENSION  numrows 
)
for ( i  = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk)

References bytesperrow, cinfo, FAR, file_offset, i, and MIN.

if ( sizeofobject  ,
(size_t)(MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr))   
)
request_virt_barray ( j_common_ptr  cinfo,
int  pool_id,
boolean  pre_zero,
JDIMENSION  blocksperrow,
JDIMENSION  numrows,
JDIMENSION  maxaccess 
)
request_virt_sarray ( j_common_ptr  cinfo,
int  pool_id,
boolean  pre_zero,
JDIMENSION  samplesperrow,
JDIMENSION  numrows,
JDIMENSION  maxaccess 
)
return ( void *  )

avail_mem
Initial value:
mem->total_space_allocated)
long maximum_space
Definition: jmemmgr.c:585
(* cinfo)(cinfo,(long) length)
Definition: jdmarker.c:730
jpeg_mem_available(j_common_ptr cinfo, long min_bytes_needed, long max_bytes_needed, long already_allocated)
Definition: jmemsdram.c:113
The heap is made up as a list of structs of this type.
Definition: lwip-1.4.0/src/core/mem.c:155
long space_per_minheight
Definition: jmemmgr.c:585
hdr_ptr hdr bytes_left = sizeofobject
hdr_ptr hdr bytes_used = sizeofobject
bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE)

Referenced by for().

data_ptr = (char *) (hdr_ptr + 1)
else
Initial value:
{
long avail_mem
Definition: jmemmgr.c:585
long max_minheights
Definition: jmemmgr.c:588
long space_per_minheight
Definition: jmemmgr.c:585
const size_t extra_pool_slop[JPOOL_NUMPOOLS]
static
Initial value:
=
{
0,
5000
}
file_offset = ptr->cur_start_row * bytesperrow

Referenced by for().

const size_t first_pool_slop[JPOOL_NUMPOOLS]
static
Initial value:
=
{
1600,
16000
}
small_pool_ptr hdr_ptr
Initial value:
{
Definition: jmemmgr.c:116
my_memory_mgr * my_mem_ptr
Definition: jmemmgr.c:140
(* cinfo)(cinfo,(long) length)
Definition: jdmarker.c:730
The heap is made up as a list of structs of this type.
Definition: lwip-1.4.0/src/core/mem.c:155

Referenced by if().

max_minheights = 1000000000L
maximum_space = 0

Referenced by for().

size_t min_request

Referenced by if().

long minheights
size_t odd_bytes
small_pool_ptr prev_hdr_ptr

Referenced by if().

return
size_t slop

Referenced by if().

space_per_minheight
Initial value:
{
Definition: jmemmgr.c:116
my_memory_mgr * my_mem_ptr
Definition: jmemmgr.c:140
(* cinfo)(cinfo,(long) length)
Definition: jdmarker.c:730
The heap is made up as a list of structs of this type.
Definition: lwip-1.4.0/src/core/mem.c:155

Referenced by for(), and free_pool().