Searched defs:nmemb (Results 1 - 25 of 37) sorted by relevance

12

/external/chromium_org/third_party/libwebp/utils/
H A Dutils.c24 // Returns 0 in case of overflow of nmemb * size.
25 static int CheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) { argument
26 const uint64_t total_size = nmemb * size;
27 if (nmemb == 0) return 1;
28 if ((uint64_t)size > WEBP_MAX_ALLOCABLE_MEMORY / nmemb) return 0;
33 void* WebPSafeMalloc(uint64_t nmemb, size_t size) { argument
34 if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL;
35 assert(nmemb * size > 0);
36 return malloc((size_t)(nmemb * size));
39 void* WebPSafeCalloc(uint64_t nmemb, size_ argument
[all...]
/external/webp/src/utils/
H A Dutils.c24 // Returns 0 in case of overflow of nmemb * size.
25 static int CheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) { argument
26 const uint64_t total_size = nmemb * size;
27 if (nmemb == 0) return 1;
28 if ((uint64_t)size > WEBP_MAX_ALLOCABLE_MEMORY / nmemb) return 0;
33 void* WebPSafeMalloc(uint64_t nmemb, size_t size) { argument
34 if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL;
35 assert(nmemb * size > 0);
36 return malloc((size_t)(nmemb * size));
39 void* WebPSafeCalloc(uint64_t nmemb, size_ argument
[all...]
/external/openssh/openbsd-compat/
H A Dbsd-poll.c45 size_t nmemb; local
57 nmemb = howmany(maxfd + 1 , NFDBITS);
58 if ((readfds = calloc(nmemb, sizeof(fd_mask))) == NULL ||
59 (writefds = calloc(nmemb, sizeof(fd_mask))) == NULL ||
60 (exceptfds = calloc(nmemb, sizeof(fd_mask))) == NULL) {
/external/compiler-rt/lib/asan/
H A Dasan_malloc_linux.cc28 DECLARE_REAL_AND_INTERCEPTOR(void*, calloc, uptr nmemb, uptr size)
78 INTERCEPTOR(void*, calloc, uptr nmemb, uptr size) { argument
84 uptr size_in_words = ((nmemb * size) + kWordSize - 1) / kWordSize;
91 return asan_calloc(nmemb, size, &stack);
H A Dasan_malloc_win.cc57 void *calloc(size_t nmemb, size_t size) { argument
59 return asan_calloc(nmemb, size, &stack);
66 void *_calloc_impl(size_t nmemb, size_t size, int *errno_tmp) { argument
67 return calloc(nmemb, size);
H A Dasan_malloc_mac.cc124 INTERCEPTOR(void *, calloc, size_t nmemb, size_t size) { argument
127 return asan_calloc(nmemb, size, &stack);
170 void *mz_calloc(malloc_zone_t *zone, size_t nmemb, size_t size) { argument
176 size_t size_in_words = ((nmemb * size) + kWordSize - 1) / kWordSize;
183 return asan_calloc(nmemb, size, &stack);
/external/openssh/
H A Dxmalloc.c41 xcalloc(size_t nmemb, size_t size) argument
45 if (size == 0 || nmemb == 0)
47 if (SIZE_T_MAX / nmemb < size)
48 fatal("xcalloc: nmemb * size > SIZE_T_MAX");
49 ptr = calloc(nmemb, size);
52 (u_long)(size * nmemb));
57 xrealloc(void *ptr, size_t nmemb, size_t size) argument
60 size_t new_size = nmemb * size;
64 if (SIZE_T_MAX / nmemb < size)
65 fatal("xrealloc: nmemb * siz
[all...]
/external/chromium_org/base/
H A Dsecurity_unittest.cc209 bool CallocReturnsNull(size_t nmemb, size_t size) { argument
211 static_cast<char*>(calloc(nmemb, size)));
/external/chromium_org/third_party/yasm/source/patched-yasm/libyasm/
H A Dmergesort.c102 yasm__mergesort(void *base, size_t nmemb, size_t size, argument
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/compiler-rt/lib/sanitizer_common/tests/
H A Dsanitizer_allocator_testlib.cc88 void *calloc(size_t nmemb, size_t size) { argument
91 size *= nmemb;
/external/chromium_org/third_party/mesa/src/src/mesa/main/
H A Dimports.c471 _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, argument
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/
H A Dunix-fns.c105 void test_calloc_nowarn(size_t nmemb, size_t size) { argument
106 char *foo = calloc(nmemb, size); // no-warning
/external/compiler-rt/lib/lsan/
H A Dlsan_interceptors.cc71 INTERCEPTOR(void*, calloc, uptr nmemb, uptr size) { argument
72 if (CallocShouldReturnNullDueToOverflow(size, nmemb)) return 0;
75 size *= nmemb;
/external/mesa3d/src/mesa/main/
H A Dimports.c471 _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, argument
477 while (nmemb) {
478 nmemb >>= 1;
479 mid = (char *)base + nmemb * size;
485 --nmemb;
490 return bsearch(key, base, nmemb, size, compar);
/external/qemu/distrib/sdl-1.2.15/src/stdlib/
H A DSDL_qsort.c242 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, argument
330 first=(char*)base; last=first+(nmemb-1)*size;
351 static void qsort_aligned(void *base, size_t nmemb, size_t size, argument
361 first=(char*)base; last=first+(nmemb-1)*size;
382 static void qsort_words(void *base, size_t nmemb, argument
391 first=(char*)base; last=first+(nmemb-1)*WORD_BYTES;
417 last=((char*)base)+nmemb*WORD_BYTE
431 qsort(void *base, size_t nmemb, size_t size, int (*compare)(const void *, const void *)) argument
[all...]
/external/valgrind/main/drd/
H A Ddrd_malloc_wrappers.c158 static void* drd_calloc(ThreadId tid, SizeT nmemb, SizeT size1) argument
160 return new_block(tid, nmemb*size1, VG_(clo_alignment),
/external/valgrind/main/drd/tests/
H A Dunit_bitmap.c65 void VG_(ssort)( void* base, SizeT nmemb, SizeT size, argument
/external/wpa_supplicant_8/hostapd/src/utils/
H A Dos.h185 * @nmemb: Number of members in the array
189 * This function can be used as a wrapper for os_zalloc(nmemb * size) when an
195 static inline void * os_calloc(size_t nmemb, size_t size) argument
197 if (size && nmemb > (~(size_t) 0) / size)
199 return os_zalloc(nmemb * size);
489 static inline void * os_realloc_array(void *ptr, size_t nmemb, size_t size) argument
491 if (size && nmemb > (~(size_t) 0) / size)
493 return os_realloc(ptr, nmemb * size);
/external/wpa_supplicant_8/src/utils/
H A Dos.h185 * @nmemb: Number of members in the array
189 * This function can be used as a wrapper for os_zalloc(nmemb * size) when an
195 static inline void * os_calloc(size_t nmemb, size_t size) argument
197 if (size && nmemb > (~(size_t) 0) / size)
199 return os_zalloc(nmemb * size);
489 static inline void * os_realloc_array(void *ptr, size_t nmemb, size_t size) argument
491 if (size && nmemb > (~(size_t) 0) / size)
493 return os_realloc(ptr, nmemb * size);
/external/wpa_supplicant_8/wpa_supplicant/src/utils/
H A Dos.h185 * @nmemb: Number of members in the array
189 * This function can be used as a wrapper for os_zalloc(nmemb * size) when an
195 static inline void * os_calloc(size_t nmemb, size_t size) argument
197 if (size && nmemb > (~(size_t) 0) / size)
199 return os_zalloc(nmemb * size);
489 static inline void * os_realloc_array(void *ptr, size_t nmemb, size_t size) argument
491 if (size && nmemb > (~(size_t) 0) / size)
493 return os_realloc(ptr, nmemb * size);
/external/aac/libSYS/src/
H A DgenericStds.cpp392 UINT FDKfwrite(void *ptrf, INT size, UINT nmemb, FDKFILE *fp) { return fwrite(ptrf, size, nmemb, (FILE*)fp); } argument
395 UINT FDKfread(void *dst, INT size, UINT nmemb, FDKFILE *fp) { return fread(dst, size, nmemb, (FILE*)fp); } argument
405 UINT FDKfwrite_EL(void *ptrf, INT size, UINT nmemb, FDKFILE *fp) { argument
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) { argument
436 for (n=0; n<nmemb;
[all...]
/external/chromium/chrome/browser/safe_browsing/
H A Dsafe_browsing_store_file.cc52 // Read an array of |nmemb| items from |fp| into |ptr|, and fold the
56 bool ReadArray(T* ptr, size_t nmemb, FILE* fp, MD5Context* context) { argument
57 const size_t ret = fread(ptr, sizeof(T), nmemb, fp);
58 if (ret != nmemb)
62 MD5Update(context, ptr, sizeof(T) * nmemb);
66 // Write an array of |nmemb| items from |ptr| to |fp|, and fold the
70 bool WriteArray(const T* ptr, size_t nmemb, FILE* fp, MD5Context* context) { argument
71 const size_t ret = fwrite(ptr, sizeof(T), nmemb, fp);
72 if (ret != nmemb)
76 MD5Update(context, ptr, sizeof(T) * nmemb);
[all...]
/external/valgrind/main/coregrind/
H A Dm_libcbase.c804 void VG_(ssort)( void* base, SizeT nmemb, SizeT size, argument
807 bm_qsort(base,nmemb,size,compar);
/external/valgrind/main/exp-sgcheck/
H A Dh_main.c374 void* h_replace_calloc ( ThreadId tid, SizeT nmemb, SizeT size1 ) argument
376 return alloc_and_new_mem_heap ( tid, nmemb*size1, VG_(clo_alignment),
/external/valgrind/main/memcheck/
H A Dmc_malloc_wrappers.c336 void* MC_(calloc) ( ThreadId tid, SizeT nmemb, SizeT size1 ) argument
338 if (complain_about_silly_args2(nmemb, size1)) {
341 return MC_(new_block) ( tid, 0, nmemb*size1, VG_(clo_alignment),

Completed in 813 milliseconds

12