Searched refs:nmemb (Results 1 - 25 of 69) sorted by relevance

123

/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/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/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/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...]
H A Dutils.h38 WEBP_EXTERN(void*) WebPSafeMalloc(uint64_t nmemb, size_t size);
41 WEBP_EXTERN(void*) WebPSafeCalloc(uint64_t nmemb, size_t size);
/external/flac/include/FLAC/
H A Dcallback.h97 * \param nmemb The number of records to be read.
102 typedef size_t (*FLAC__IOCallback_Read) (void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle);
110 * \param nmemb The number of records to be written.
115 typedef size_t (*FLAC__IOCallback_Write) (const void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle);
/external/compiler-rt/lib/asan/
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);
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);
/external/clang/test/Analysis/
H A Dmalloc-sizeof.cpp6 void *calloc(size_t nmemb, size_t size);
H A Dmalloc-sizeof.c6 void *calloc(size_t nmemb, size_t size);
H A Dmalloc.cpp7 void *calloc(size_t nmemb, size_t size);
H A Dstream.c11 extern size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
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/aac/libSYS/src/
H A DgenericStds.cpp397 UINT FDKfwrite(void *ptrf, INT size, UINT nmemb, FDKFILE *fp) { return fwrite(ptrf, size, nmemb, (FILE*)fp); } argument
400 UINT FDKfread(void *dst, INT size, UINT nmemb, FDKFILE *fp) { return fread(dst, size, nmemb, (FILE*)fp); } argument
410 UINT FDKfwrite_EL(void *ptrf, INT size, UINT nmemb, FDKFILE *fp) { argument
413 FDKfwrite(ptrf, size, nmemb, fp);
420 for (n=0; n<nmemb; n++) {
428 return nmemb;
432 UINT FDKfread_EL(void *dst, INT size, UINT nmemb, FDKFILE *fp) { argument
441 for (n=0; n<nmemb;
[all...]
/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/valgrind/coregrind/
H A Dpub_core_replacemalloc.h48 void* (*tl_calloc) (ThreadId tid, SizeT nmemb, SizeT n);
/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/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/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/valgrind/exp-sgcheck/
H A Dh_main.h63 void* h_replace_calloc ( ThreadId tid, SizeT nmemb, SizeT size1 );
/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;

Completed in 1144 milliseconds

123