Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c

Issue 372473003: Remove custom memory manager (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Change malloc to calloc Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: 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 77a864ebb97c74927040b2ad00da0f2644f5138b..bf411efca5bda7069e8c829301c44233ec90ea7c 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
« no previous file with comments | « core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/dwt.c ('k') | core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/opj_malloc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698