Main MRPT website > C++ reference for MRPT 1.5.9
jmemnobs.cpp
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 #define JPEG_INTERNALS
11 #include "jinclude.h"
12 #include "mrpt_jpeglib.h"
13 #include "jmemsys.h" /* import the system-dependent declarations */
14 
15 #ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc(),free() */
16 extern void * malloc JPP((size_t size));
17 extern void free JPP((void *ptr));
18 #endif
19 
20 
21 /*
22  * Memory allocation and freeing are controlled by the regular library
23  * routines malloc() and free().
24  */
25 
26 GLOBAL(void *)
28 {
29  return (void *) malloc(sizeofobject);
30 }
31 
32 GLOBAL(void)
33 jpeg_free_small (j_common_ptr , void * object, size_t )
34 {
35  free(object);
36 }
37 
38 
39 /*
40  * "Large" objects are treated the same as "small" ones.
41  * NB: although we include FAR keywords in the routine declarations,
42  * this file won't actually work in 80x86 small/medium model; at least,
43  * you probably won't be able to process useful-size images in only 64KB.
44  */
45 
46 GLOBAL(void FAR *)
48 {
49  return (void FAR *) malloc(sizeofobject);
50 }
51 
52 GLOBAL(void)
53 jpeg_free_large (j_common_ptr , void FAR * object, size_t )
54 {
55  free(object);
56 }
57 
58 
59 /*
60  * This routine computes the total memory space available for allocation.
61  * Here we always say, "we got all you want bud!"
62  */
63 
64 GLOBAL(long)
66  long max_bytes_needed, long )
67 {
68  return max_bytes_needed;
69 }
70 
71 
72 /*
73  * Backing store (temporary file) management.
74  * Since jpeg_mem_available always promised the moon,
75  * this should never be called and we can just error out.
76  */
77 
78 GLOBAL(void)
80  long )
81 {
82  ERREXIT(cinfo, JERR_NO_BACKING_STORE);
83 }
84 
85 
86 /*
87  * These routines take care of any system-dependent initialization and
88  * cleanup required. Here, there isn't any.
89  */
90 
91 GLOBAL(long)
93 {
94  return 0; /* just set max_memory_to_use to 0 */
95 }
96 
97 GLOBAL(void)
99 {
100  /* no work */
101 }
jpeg_mem_init(j_common_ptr)
Definition: jmemnobs.cpp:92
jpeg_get_small(j_common_ptr, size_t sizeofobject)
Definition: jmemnobs.cpp:27
long long max_bytes_needed
Definition: jmemsys.h:93
jpeg_free_small(j_common_ptr, void *object, size_t)
Definition: jmemnobs.cpp:33
#define ERREXIT(cinfo, code)
Definition: jerror.h:199
size_t sizeofobject
Definition: jmemsys.h:36
jpeg_open_backing_store(j_common_ptr cinfo, backing_store_ptr, long)
Definition: jmemnobs.cpp:79
#define JPP(arglist)
Definition: mrpt_jpeglib.h:815
jpeg_mem_available(j_common_ptr, long, long max_bytes_needed, long)
Definition: jmemnobs.cpp:65
jpeg_mem_term(j_common_ptr)
Definition: jmemnobs.cpp:98
#define GLOBAL(type)
Definition: jmorecfg.h:185
jpeg_free_large(j_common_ptr, void FAR *object, size_t)
Definition: jmemnobs.cpp:53
GLsizeiptr size
Definition: glext.h:3779
#define FAR
Definition: zconf.h:261
jpeg_get_large(j_common_ptr, size_t sizeofobject)
Definition: jmemnobs.cpp:47



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020