aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/jpeg-6b/jmemnobs.c
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-02-01 15:45:39 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-02-01 15:45:39 +0100
commit35244064bbb2a853fb5c08898e8a74a7ec489aaa (patch)
treee9b7ccb8b46174301ccf106807ea2fcd640350e5 /test/monniaux/jpeg-6b/jmemnobs.c
parent8ae9063a94fbf3756bb2b1d596f35b81e3e608eb (diff)
downloadcompcert-kvx-35244064bbb2a853fb5c08898e8a74a7ec489aaa.tar.gz
compcert-kvx-35244064bbb2a853fb5c08898e8a74a7ec489aaa.zip
block tail calls etc.
Diffstat (limited to 'test/monniaux/jpeg-6b/jmemnobs.c')
-rw-r--r--test/monniaux/jpeg-6b/jmemnobs.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/test/monniaux/jpeg-6b/jmemnobs.c b/test/monniaux/jpeg-6b/jmemnobs.c
index 8bf9f8be..02e14a1a 100644
--- a/test/monniaux/jpeg-6b/jmemnobs.c
+++ b/test/monniaux/jpeg-6b/jmemnobs.c
@@ -25,6 +25,7 @@ extern void * malloc JPP((size_t size));
extern void free JPP((void *ptr));
#endif
+
/*
* Memory allocation and freeing are controlled by the regular library
* routines malloc() and free().
@@ -33,21 +34,16 @@ extern void free JPP((void *ptr));
GLOBAL(void *)
jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
{
- void *p= (void *) malloc(sizeofobject);
- if (p==NULL) { /* DM */
- printf("malloc (%zu) failed\n", sizeofobject);
- }
- return p;
+ return (void *) malloc(sizeofobject);
}
GLOBAL(void)
jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
{
-#ifdef DMONNIAUX_FREE
free(object);
-#endif
}
+
/*
* "Large" objects are treated the same as "small" ones.
* NB: although we include FAR keywords in the routine declarations,
@@ -64,11 +60,10 @@ 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)
{
-#ifdef DMONNIAUX_FREE
- free((void*)object);
-#endif
+ free(object);
}
+
/*
* This routine computes the total memory space available for allocation.
* Here we always say, "we got all you want bud!"
@@ -93,7 +88,7 @@ jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
long total_bytes_needed)
{
ERREXIT(cinfo, JERR_NO_BACKING_STORE);
- KILL_TAIL_CALL
+ KILL_TAIL_CALL();
}