From 3522876d5291922ddc62bf1b70d02743b0850673 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Tue, 8 Jul 2014 15:30:46 -0700 Subject: Remove custom memory manager BUG= R=palmer@chromium.org Review URL: https://codereview.chromium.org/372473003 --- .../src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c | 40 ---------------------- 1 file changed, 40 deletions(-) (limited to 'core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c') diff --git a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c index 77a864ebb9..bf411efca5 100644 --- a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c +++ b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c @@ -10253,43 +10253,3 @@ OPJ_BOOL opj_j2k_write_tile (opj_j2k_t * p_j2k, return OPJ_TRUE; } - -#ifdef _FOXIT_MEM_MANAGER_ -/** Allocate number of bytes */ -void* FXMEM_DefaultAlloc(int byte_size, int flags); -void* FXMEM_DefaultRealloc(void* pointer, int new_size, int flags); -void FXMEM_DefaultFree(void* pointer, int flags); - -void* opj_malloc(size_t size) -{ - if (size >= (size_t)-0x100 || (int)size < 0) return NULL; - - return FXMEM_DefaultAlloc(size, 0); -} - -void* opj_calloc(size_t _NumOfElements, size_t _SizeOfElements) -{ - void* buffer = NULL; - - if (_NumOfElements != 0 && _NumOfElements >= (size_t)-0x100 / _SizeOfElements) return NULL; - if ((int)_NumOfElements < 0 || (int)_SizeOfElements < 0) return NULL; - - buffer = FXMEM_DefaultAlloc(_NumOfElements * _SizeOfElements, 0); - if (!buffer) return 0; - - memset(buffer, 0, _NumOfElements * _SizeOfElements); - return buffer; -} - -void* opj_realloc(void * m, size_t s) -{ - if (s >= (size_t)-0x100 || (int)s < 0) return NULL; - return FXMEM_DefaultRealloc(m, s, 0); -} - -void opj_free(void * m) -{ - FXMEM_DefaultFree(m, 0); -} - -#endif -- cgit v1.2.3