7 * Copyright (C) 1992-1994, Thomas G. Lane.
\r
9 * This file is part of the Independent JPEG Group's software.
\r
11 * For conditions of distribution and use, see the accompanying README file.
\r
15 * This file provides a really simple implementation of the system-
\r
17 * dependent portion of the JPEG memory manager. This implementation
\r
19 * assumes that no backing-store files are needed: all required space
\r
21 * can be obtained from ri.Malloc().
\r
23 * This is very portable in the sense that it'll compile on almost anything,
\r
25 * but you'd better have lots of main memory (or virtual memory) if you want
\r
27 * to process big images.
\r
29 * Note that the max_memory_to_use option is ignored by this implementation.
\r
35 #define JPEG_INTERNALS
\r
37 #include "jinclude.h"
\r
39 #include "radiant_jpeglib.h"
\r
41 #include "jmemsys.h" /* import the system-dependent declarations */
\r
47 * Memory allocation and ri.Freeing are controlled by the regular library
\r
49 * routines ri.Malloc() and ri.Free().
\r
57 jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
\r
61 return (void *) malloc(sizeofobject);
\r
69 jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
\r
83 * "Large" objects are treated the same as "small" ones.
\r
85 * NB: although we include FAR keywords in the routine declarations,
\r
87 * this file won't actually work in 80x86 small/medium model; at least,
\r
89 * you probably won't be able to process useful-size images in only 64KB.
\r
97 jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
\r
101 return (void FAR *) malloc(sizeofobject);
\r
109 jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
\r
123 * This routine computes the total memory space available for allocation.
\r
125 * Here we always say, "we got all you want bud!"
\r
133 jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
\r
135 long max_bytes_needed, long already_allocated)
\r
139 return max_bytes_needed;
\r
149 * Backing store (temporary file) management.
\r
151 * Since jpeg_mem_available always promised the moon,
\r
153 * this should never be called and we can just error out.
\r
161 jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
\r
163 long total_bytes_needed)
\r
167 ERREXIT(cinfo, JERR_NO_BACKING_STORE);
\r
177 * These routines take care of any system-dependent initialization and
\r
179 * cleanup required. Here, there isn't any.
\r
187 jpeg_mem_init (j_common_ptr cinfo)
\r
191 return 0; /* just set max_memory_to_use to 0 */
\r
199 jpeg_mem_term (j_common_ptr cinfo)
\r