diff options
| author | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2010-04-08 17:22:58 +0000 |
|---|---|---|
| committer | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2010-04-08 17:22:58 +0000 |
| commit | 627f484bce7b572dfcbd13f90f5f6fb083d1008c (patch) | |
| tree | 44e55f6d330d2b0c522f57cae8afcde8d9d33b4c /libopenjpeg/opj_malloc.h | |
| parent | d03779ee2a035509737ec452a2f2c75ef4fef032 (diff) | |
Significant optimizations of MCT, DWT, MQ and T1 modules by Peter Wimmer (thanks Peter)
Diffstat (limited to 'libopenjpeg/opj_malloc.h')
| -rw-r--r-- | libopenjpeg/opj_malloc.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libopenjpeg/opj_malloc.h b/libopenjpeg/opj_malloc.h index 9b48c256..c477aec0 100644 --- a/libopenjpeg/opj_malloc.h +++ b/libopenjpeg/opj_malloc.h @@ -45,7 +45,11 @@ Allocate an uninitialized memory block @param size Bytes to allocate
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
*/
+#ifdef ALLOC_PERF_OPT
+void * OPJ_CALLCONV opj_malloc(size_t size);
+#else
#define opj_malloc(size) malloc(size)
+#endif
/**
Allocate a memory block with elements initialized to 0
@@ -53,7 +57,11 @@ Allocate a memory block with elements initialized to 0 @param size Bytes per block to allocate
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
*/
+#ifdef ALLOC_PERF_OPT
+void * OPJ_CALLCONV opj_calloc(size_t _NumOfElements, size_t _SizeOfElements);
+#else
#define opj_calloc(num, size) calloc(num, size)
+#endif
/**
Allocate memory aligned to a 16 byte boundry
@@ -113,19 +121,34 @@ Allocate memory aligned to a 16 byte boundry #define opj_aligned_free(m) free(m)
#endif
+#ifdef ALLOC_PERF_OPT
+ #undef opj_aligned_malloc
+ #define opj_aligned_malloc(size) opj_malloc(size)
+ #undef opj_aligned_free
+ #define opj_aligned_free(m) opj_free(m)
+#endif
+
/**
Reallocate memory blocks.
@param memblock Pointer to previously allocated memory block
@param size New size in bytes
@return Returns a void pointer to the reallocated (and possibly moved) memory block
*/
+#ifdef ALLOC_PERF_OPT
+void * OPJ_CALLCONV opj_realloc(void * _Memory, size_t NewSize);
+#else
#define opj_realloc(m, s) realloc(m, s)
+#endif
/**
Deallocates or frees a memory block.
@param memblock Previously allocated memory block to be freed
*/
+#ifdef ALLOC_PERF_OPT
+void OPJ_CALLCONV opj_free(void * _Memory);
+#else
#define opj_free(m) free(m)
+#endif
#ifdef __GNUC__
#pragma GCC poison malloc calloc realloc free
|
