/external/chromium_org/third_party/brotli/src/brotli/dec/ |
safe_malloc.c | 25 /* Returns 0 in case of overflow of nmemb * size. */ 26 static int CheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) { 27 const uint64_t total_size = nmemb * size; 28 if (nmemb == 0) return 1; 29 if ((uint64_t)size > BROTLI_MAX_ALLOCABLE_MEMORY / nmemb) return 0; 34 void* BrotliSafeMalloc(uint64_t nmemb, size_t size) { 35 if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL; 36 assert(nmemb * size > 0); 37 return malloc((size_t)(nmemb * size));
|
safe_malloc.h | 39 void* BrotliSafeMalloc(uint64_t nmemb, size_t size);
|
/external/valgrind/main/memcheck/tests/ |
undef_malloc_args.c | 28 size_t nmemb = 1; local 29 (void) VALGRIND_MAKE_MEM_UNDEFINED(&nmemb, 1); 30 new_p = calloc(nmemb, def_size); 42 size_t nmemb = 16; 45 new_p = memalign(nmemb, size);
|
/external/chromium_org/third_party/libwebp/utils/ |
utils.c | 163 // Returns 0 in case of overflow of nmemb * size. 164 static int CheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) { 165 const uint64_t total_size = nmemb * size; 166 if (nmemb == 0) return 1; 167 if ((uint64_t)size > WEBP_MAX_ALLOCABLE_MEMORY / nmemb) return 0; 183 void* WebPSafeMalloc(uint64_t nmemb, size_t size) { 186 if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL; 187 assert(nmemb * size > 0); 188 ptr = malloc((size_t)(nmemb * size)); 189 AddMem(ptr, (size_t)(nmemb * size)) [all...] |
utils.h | 38 WEBP_EXTERN(void*) WebPSafeMalloc(uint64_t nmemb, size_t size); 41 WEBP_EXTERN(void*) WebPSafeCalloc(uint64_t nmemb, size_t size);
|
/external/webp/src/utils/ |
utils.c | 163 // Returns 0 in case of overflow of nmemb * size. 164 static int CheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) { 165 const uint64_t total_size = nmemb * size; 166 if (nmemb == 0) return 1; 167 if ((uint64_t)size > WEBP_MAX_ALLOCABLE_MEMORY / nmemb) return 0; 183 void* WebPSafeMalloc(uint64_t nmemb, size_t size) { 186 if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL; 187 assert(nmemb * size > 0); 188 ptr = malloc((size_t)(nmemb * size)); 189 AddMem(ptr, (size_t)(nmemb * size)) [all...] |
utils.h | 38 WEBP_EXTERN(void*) WebPSafeMalloc(uint64_t nmemb, size_t size); 41 WEBP_EXTERN(void*) WebPSafeCalloc(uint64_t nmemb, size_t size);
|
/bionic/libc/upstream-netbsd/lib/libc/stdlib/ |
bsearch.c | 62 bsearch(const void *key, const void *base0, size_t nmemb, size_t size, 71 _DIAGASSERT(base0 != NULL || nmemb == 0); 74 for (lim = nmemb; lim != 0; lim >>= 1) {
|
/external/flac/include/FLAC/ |
callback.h | 96 * \param nmemb The number of records to be read. 101 typedef size_t (*FLAC__IOCallback_Read) (void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle); 109 * \param nmemb The number of records to be written. 114 typedef size_t (*FLAC__IOCallback_Write) (const void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle);
|
/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/sysroot/usr/include/ |
af_vfs.h | 49 size_t af_fread (void *data, size_t size, size_t nmemb, AFvirtualfile *vfile); 50 size_t af_fwrite (const void *data, size_t size, size_t nmemb, AFvirtualfile *vfile);
|
/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/sysroot/usr/include/ |
af_vfs.h | 49 size_t af_fread (void *data, size_t size, size_t nmemb, AFvirtualfile *vfile); 50 size_t af_fwrite (const void *data, size_t size, size_t nmemb, AFvirtualfile *vfile);
|
/external/aac/libSYS/src/ |
genericStds.cpp | 392 UINT FDKfwrite(void *ptrf, INT size, UINT nmemb, FDKFILE *fp) { return fwrite(ptrf, size, nmemb, (FILE*)fp); } 395 UINT FDKfread(void *dst, INT size, UINT nmemb, FDKFILE *fp) { return fread(dst, size, nmemb, (FILE*)fp); } 405 UINT FDKfwrite_EL(void *ptrf, INT size, UINT nmemb, FDKFILE *fp) { 408 FDKfwrite(ptrf, size, nmemb, fp); 415 for (n=0; n<nmemb; n++) { 423 return nmemb; 427 UINT FDKfread_EL(void *dst, INT size, UINT nmemb, FDKFILE *fp) { 436 for (n=0; n<nmemb; n++) [all...] |
/external/compiler-rt/lib/asan/ |
asan_malloc_win.cc | 62 void *calloc(size_t nmemb, size_t size) { 64 return asan_calloc(nmemb, size, &stack); 73 void *_calloc_impl(size_t nmemb, size_t size, int *errno_tmp) { 74 return calloc(nmemb, size);
|
asan_malloc_linux.cc | 29 DECLARE_REAL_AND_INTERCEPTOR(void*, calloc, uptr nmemb, uptr size) 83 INTERCEPTOR(void*, calloc, uptr nmemb, uptr size) { 89 uptr size_in_words = ((nmemb * size) + kWordSize - 1) / kWordSize; 96 return asan_calloc(nmemb, size, &stack);
|
/external/qemu/distrib/sdl-1.2.15/src/stdlib/ |
SDL_qsort.c | 242 last=first + (nmemb>limit ? limit : nmemb-1)*sz;\ 250 last=((char*)base)+nmemb*size; \ 320 static void qsort_nonaligned(void *base, size_t nmemb, size_t size, 330 first=(char*)base; last=first+(nmemb-1)*size; 351 static void qsort_aligned(void *base, size_t nmemb, size_t size, 361 first=(char*)base; last=first+(nmemb-1)*size; 382 static void qsort_words(void *base, size_t nmemb, 391 first=(char*)base; last=first+(nmemb-1)*WORD_BYTES; 417 last=((char*)base)+nmemb*WORD_BYTES [all...] |
/external/wpa_supplicant_8/src/utils/ |
os.h | 260 * @nmemb: Number of members in the array 264 * This function can be used as a wrapper for os_zalloc(nmemb * size) when an 270 static inline void * os_calloc(size_t nmemb, size_t size) 272 if (size && nmemb > (~(size_t) 0) / size) 274 return os_zalloc(nmemb * size); 552 static inline void * os_realloc_array(void *ptr, size_t nmemb, size_t size) 554 if (size && nmemb > (~(size_t) 0) / size) 556 return os_realloc(ptr, nmemb * size); 562 * @nmemb: Current member count of the array 566 static inline void os_remove_in_array(void *ptr, size_t nmemb, size_t size [all...] |
/external/valgrind/main/coregrind/ |
pub_core_replacemalloc.h | 48 void* (*tl_calloc) (ThreadId tid, SizeT nmemb, SizeT n);
|
/ndk/sources/host-tools/sed-4.2.1/sed/ |
utils.h | 27 void ck_fwrite P_((const VOID *ptr, size_t size, size_t nmemb, FILE *stream)); 28 size_t ck_fread P_((VOID *ptr, size_t size, size_t nmemb, FILE *stream));
|
utils.c | 238 ck_fwrite(ptr, size, nmemb, stream) 241 size_t nmemb; 245 if (size && fwrite(ptr, size, nmemb, stream) != nmemb) 247 "couldn't write %d items to %s: %s", nmemb), 248 nmemb, utils_fp_name(stream), strerror(errno)); 253 ck_fread(ptr, size, nmemb, stream) 256 size_t nmemb; 260 if (size && (nmemb=fread(ptr, size, nmemb, stream)) <= 0 && ferror(stream) [all...] |
/external/chromium_org/third_party/yasm/source/patched-yasm/libyasm/ |
mergesort.c | 102 yasm__mergesort(void *base, size_t nmemb, size_t size, 106 return mergesort(base, nmemb, size, cmp); 121 if (nmemb == 0) 132 if ((list2 = yasm_xmalloc(nmemb * size + PSIZE)) == NULL) 136 setup(list1, list2, nmemb, size, cmp); 137 last = list2 + nmemb * size; 233 last = list2 + nmemb*size; 236 memmove(list2, list1, nmemb*size);
|
/external/chromium_org/third_party/mesa/src/src/mesa/main/ |
imports.c | 471 _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, 477 while (nmemb) { 478 nmemb >>= 1; 479 mid = (char *)base + nmemb * size; 485 --nmemb; 490 return bsearch(key, base, nmemb, size, compar);
|
/external/mesa3d/src/mesa/main/ |
imports.c | 471 _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, 477 while (nmemb) { 478 nmemb >>= 1; 479 mid = (char *)base + nmemb * size; 485 --nmemb; 490 return bsearch(key, base, nmemb, size, compar);
|
/external/clang/test/Analysis/ |
malloc-sizeof.c | 6 void *calloc(size_t nmemb, size_t size);
|
malloc.cpp | 7 void *calloc(size_t nmemb, size_t size);
|
stream.c | 11 extern size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
|