587 long space_per_minheight, maximum_space, avail_mem;
588 long minheights, max_minheights;
596 space_per_minheight = 0;
599 if (sptr->mem_buffer == NULL) {
600 space_per_minheight += (long) sptr->
maxaccess *
602 maximum_space += (long) sptr->rows_in_array *
607 if (bptr->mem_buffer == NULL) {
608 space_per_minheight += (long) bptr->maxaccess *
610 maximum_space += (long) bptr->rows_in_array *
615 if (space_per_minheight <= 0)
626 if (avail_mem >= maximum_space)
627 max_minheights = 1000000000L;
629 max_minheights = avail_mem / space_per_minheight;
633 if (max_minheights <= 0)
640 if (sptr->mem_buffer == NULL) {
641 minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L;
642 if (minheights <= max_minheights) {
644 sptr->rows_in_mem = sptr->rows_in_array;
647 sptr->rows_in_mem = (
JDIMENSION) (max_minheights * sptr->maxaccess);
649 (
long) sptr->rows_in_array *
650 (
long) sptr->samplesperrow *
652 sptr->b_s_open =
TRUE;
655 sptr->samplesperrow, sptr->rows_in_mem);
657 sptr->cur_start_row = 0;
658 sptr->first_undef_row = 0;
664 if (bptr->mem_buffer == NULL) {
665 minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L;
666 if (minheights <= max_minheights) {
668 bptr->rows_in_mem = bptr->rows_in_array;
671 bptr->rows_in_mem = (
JDIMENSION) (max_minheights * bptr->maxaccess);
673 (
long) bptr->rows_in_array *
674 (
long) bptr->blocksperrow *
676 bptr->b_s_open =
TRUE;
679 bptr->blocksperrow, bptr->rows_in_mem);
681 bptr->cur_start_row = 0;
682 bptr->first_undef_row = 0;
char JSAMPLE
Definition: jmorecfg.h:64
Definition: jmemmgr.cpp:116
static JBLOCKARRAY alloc_barray(j_common_ptr cinfo, int pool_id, JDIMENSION blocksperrow, JDIMENSION numrows)
Definition: jmemmgr.cpp:443
jvirt_sarray_ptr virt_sarray_list
Definition: jmemmgr.cpp:128
jvirt_sarray_ptr next
Definition: jmemmgr.cpp:162
#define SIZEOF(object)
Definition: jinclude.h:80
my_memory_mgr * my_mem_ptr
Definition: jmemmgr.cpp:140
#define JPOOL_IMAGE
Definition: jpeglib.h:754
#define FALSE
Definition: jpleph.cpp:69
long total_space_allocated
Definition: jmemmgr.cpp:132
Definition: jmemmgr.cpp:166
JDIMENSION maxaccess
Definition: jmemmgr.cpp:170
JDIMENSION last_rowsperchunk
Definition: jmemmgr.cpp:137
jvirt_barray_ptr next
Definition: jmemmgr.cpp:178
void jpeg_open_backing_store(j_common_ptr cinfo, backing_store_ptr info, long total_bytes_needed)
Definition: jmemnobs.cpp:87
Definition: jmemmgr.cpp:150
#define TRUE
Definition: jpleph.cpp:68
long jpeg_mem_available(j_common_ptr cinfo, long min_bytes_needed, long max_bytes_needed, long already_allocated)
Definition: jmemnobs.cpp:73
JCOEF JBLOCK[64]
Definition: jpeglib.h:75
jvirt_barray_ptr virt_barray_list
Definition: jmemmgr.cpp:129
static JSAMPARRAY alloc_sarray(j_common_ptr cinfo, int pool_id, JDIMENSION samplesperrow, JDIMENSION numrows)
Definition: jmemmgr.cpp:395
unsigned int JDIMENSION
Definition: jmorecfg.h:171
struct jpeg_memory_mgr * mem
Definition: jpeglib.h:259