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

12

/external/openssh/openbsd-compat/
H A Dreallocarray.c37 reallocarray(void *optr, size_t nmemb, size_t size) argument
39 if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
40 nmemb > 0 && SIZE_MAX / nmemb < size) {
44 return realloc(optr, size * nmemb);
H A Dbsd-poll.c48 size_t nmemb; local
60 nmemb = howmany(maxfd + 1 , NFDBITS);
61 if ((readfds = calloc(nmemb, sizeof(fd_mask))) == NULL ||
62 (writefds = calloc(nmemb, sizeof(fd_mask))) == NULL ||
63 (exceptfds = calloc(nmemb, sizeof(fd_mask))) == NULL) {
/external/valgrind/memcheck/tests/
H A Dundef_malloc_args.c28 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/compiler-rt/lib/asan/
H A Dasan_malloc_linux.cc44 INTERCEPTOR(void*, calloc, uptr nmemb, uptr size) { argument
50 uptr size_in_words = ((nmemb * size) + kWordSize - 1) / kWordSize;
57 return asan_calloc(nmemb, size, &stack);
H A Dasan_malloc_win.cc68 void *calloc(size_t nmemb, size_t size) { argument
70 return asan_calloc(nmemb, size, &stack);
74 void *_calloc_dbg(size_t nmemb, size_t size, int, const char *, int) { argument
75 return calloc(nmemb, size);
79 void *_calloc_impl(size_t nmemb, size_t size, int *errno_tmp) { argument
80 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);
176 void *__asan_mz_calloc(malloc_zone_t *zone, size_t nmemb, size_t size) { argument
182 size_t size_in_words = ((nmemb * size) + kWordSize - 1) / kWordSize;
189 return asan_calloc(nmemb, size, &stack);
/external/openssh/
H A Dxmalloc.c43 xcalloc(size_t nmemb, size_t size) argument
47 if (size == 0 || nmemb == 0)
49 if (SIZE_MAX / nmemb < size)
50 fatal("xcalloc: nmemb * size > SIZE_MAX");
51 ptr = calloc(nmemb, size);
54 size * nmemb);
59 xrealloc(void *ptr, size_t nmemb, size_t size) argument
62 size_t new_size = nmemb * size;
66 if (SIZE_MAX / nmemb < size)
67 fatal("xrealloc: nmemb * siz
[all...]
/external/compiler-rt/lib/lsan/
H A Dlsan_interceptors.cc62 INTERCEPTOR(void*, calloc, uptr nmemb, uptr size) { argument
68 uptr size_in_words = ((nmemb * size) + kWordSize - 1) / kWordSize;
74 if (CallocShouldReturnNullDueToOverflow(size, nmemb)) return 0;
77 size *= nmemb;
/external/flac/include/share/
H A Dalloc.h77 static inline void *safe_calloc_(size_t nmemb, size_t size) argument
79 if(!nmemb || !size)
81 return calloc(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/google-breakpad/src/common/linux/
H A Dhttp_upload.cc40 size_t nmemb, void *userp) {
45 size_t real_size = size * nmemb;
39 WriteCallback(void *ptr, size_t size, size_t nmemb, void *userp) argument
H A Dlibcurl_wrapper.cc101 size_t nmemb, void *userp) {
106 size_t real_size = size * nmemb;
100 WriteCallback(void *ptr, size_t size, size_t nmemb, void *userp) argument
/external/webp/src/utils/
H A Dutils.c163 // Returns 0 in case of overflow of nmemb * size.
164 static int CheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) { argument
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) { argument
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 * siz
193 WebPSafeCalloc(uint64_t nmemb, size_t size) argument
[all...]
/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/msan/
H A Dmsan_allocator.cc153 void *MsanCalloc(StackTrace *stack, uptr nmemb, uptr size) { argument
155 if (CallocShouldReturnNullDueToOverflow(size, nmemb))
157 return MsanReallocate(stack, 0, nmemb * size, sizeof(u64), true);
/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/valgrind/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/drd/tests/
H A Dunit_bitmap.c65 void VG_(ssort)( void* base, SizeT nmemb, SizeT size, argument
/external/fio/
H A Dsmalloc.c487 void *scalloc(size_t nmemb, size_t size) argument
491 ret = smalloc(nmemb * size);
493 memset(ret, 0, nmemb * size);
/external/wpa_supplicant_8/hostapd/src/utils/
H A Dos.h267 * @nmemb: Number of members in the array
271 * This function can be used as a wrapper for os_zalloc(nmemb * size) when an
277 static inline void * os_calloc(size_t nmemb, size_t size) argument
279 if (size && nmemb > (~(size_t) 0) / size)
281 return os_zalloc(nmemb * size);
565 static inline void * os_realloc_array(void *ptr, size_t nmemb, size_t size) argument
567 if (size && nmemb > (~(size_t) 0) / size)
569 return os_realloc(ptr, nmemb * size);
575 * @nmemb: Current member count of the array
579 static inline void os_remove_in_array(void *ptr, size_t nmemb, size_ argument
[all...]
/external/wpa_supplicant_8/src/utils/
H A Dos.h267 * @nmemb: Number of members in the array
271 * This function can be used as a wrapper for os_zalloc(nmemb * size) when an
277 static inline void * os_calloc(size_t nmemb, size_t size) argument
279 if (size && nmemb > (~(size_t) 0) / size)
281 return os_zalloc(nmemb * size);
565 static inline void * os_realloc_array(void *ptr, size_t nmemb, size_t size) argument
567 if (size && nmemb > (~(size_t) 0) / size)
569 return os_realloc(ptr, nmemb * size);
575 * @nmemb: Current member count of the array
579 static inline void os_remove_in_array(void *ptr, size_t nmemb, size_ argument
[all...]
/external/wpa_supplicant_8/wpa_supplicant/src/utils/
H A Dos.h267 * @nmemb: Number of members in the array
271 * This function can be used as a wrapper for os_zalloc(nmemb * size) when an
277 static inline void * os_calloc(size_t nmemb, size_t size) argument
279 if (size && nmemb > (~(size_t) 0) / size)
281 return os_zalloc(nmemb * size);
565 static inline void * os_realloc_array(void *ptr, size_t nmemb, size_t size) argument
567 if (size && nmemb > (~(size_t) 0) / size)
569 return os_realloc(ptr, nmemb * size);
575 * @nmemb: Current member count of the array
579 static inline void os_remove_in_array(void *ptr, size_t nmemb, size_ argument
[all...]
/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/valgrind/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/memcheck/
H A Dmc_malloc_wrappers.c420 void* MC_(calloc) ( ThreadId tid, SizeT nmemb, SizeT size1 ) argument
422 if (MC_(record_fishy_value_error)(tid, "calloc", "nmemb", nmemb) ||
426 return MC_(new_block) ( tid, 0, nmemb*size1, VG_(clo_alignment),

Completed in 718 milliseconds

12