OLD | NEW |
1 /* | 1 /* |
2 * The copyright in this software is being made available under the 2-clauses | 2 * The copyright in this software is being made available under the 2-clauses |
3 * BSD License, included below. This software may be subject to other third | 3 * BSD License, included below. This software may be subject to other third |
4 * party and contributor rights, including patent rights, and no such rights | 4 * party and contributor rights, including patent rights, and no such rights |
5 * are granted under this license. | 5 * are granted under this license. |
6 * | 6 * |
7 * Copyright (c) 2005, Herve Drolon, FreeImage Team | 7 * Copyright (c) 2005, Herve Drolon, FreeImage Team |
8 * Copyright (c) 2007, Callum Lerwick <seg@haxxed.com> | 8 * Copyright (c) 2007, Callum Lerwick <seg@haxxed.com> |
9 * All rights reserved. | 9 * All rights reserved. |
10 * | 10 * |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 #else | 72 #else |
73 /* prevent assertion on overflow for MSVC */ | 73 /* prevent assertion on overflow for MSVC */ |
74 #ifdef _MSC_VER | 74 #ifdef _MSC_VER |
75 #define opj_calloc(num, size) ((size_t)(num) != 0 && (size_t)(num) >= (size_t)-0
x100 / (size_t)(size) ? NULL : calloc(num, size)) | 75 #define opj_calloc(num, size) ((size_t)(num) != 0 && (size_t)(num) >= (size_t)-0
x100 / (size_t)(size) ? NULL : calloc(num, size)) |
76 #else | 76 #else |
77 #define opj_calloc(num, size) calloc(num, size) | 77 #define opj_calloc(num, size) calloc(num, size) |
78 #endif | 78 #endif |
79 #endif | 79 #endif |
80 | 80 |
81 /** | 81 /** |
82 Allocate memory aligned to a 16 byte boundry | 82 Allocate memory aligned to a 16 byte boundary |
83 @param size Bytes to allocate | 83 @param size Bytes to allocate |
84 @return Returns a void pointer to the allocated space, or NULL if there is insuf
ficient memory available | 84 @return Returns a void pointer to the allocated space, or NULL if there is insuf
ficient memory available |
85 */ | 85 */ |
86 /* FIXME: These should be set with cmake tests, but we're currently not requirin
g use of cmake */ | 86 /* FIXME: These should be set with cmake tests, but we're currently not requirin
g use of cmake */ |
87 #ifdef _WIN32 | 87 #ifdef _WIN32 |
88 /* Someone should tell the mingw people that their malloc.h ought to pro
vide _mm_malloc() */ | 88 /* Someone should tell the mingw people that their malloc.h ought to pro
vide _mm_malloc() */ |
89 #ifdef __GNUC__ | 89 #ifdef __GNUC__ |
90 #include <mm_malloc.h> | 90 #include <mm_malloc.h> |
91 #define HAVE_MM_MALLOC | 91 #define HAVE_MM_MALLOC |
92 #else /* MSVC, Intel C++ */ | 92 #else /* MSVC, Intel C++ */ |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 #pragma GCC poison malloc calloc realloc free | 176 #pragma GCC poison malloc calloc realloc free |
177 #endif | 177 #endif |
178 | 178 |
179 /* ----------------------------------------------------------------------- */ | 179 /* ----------------------------------------------------------------------- */ |
180 /*@}*/ | 180 /*@}*/ |
181 | 181 |
182 /*@}*/ | 182 /*@}*/ |
183 | 183 |
184 #endif /* __OPJ_MALLOC_H */ | 184 #endif /* __OPJ_MALLOC_H */ |
185 | 185 |
OLD | NEW |