Home
last modified time | relevance | path

Searched refs:nmemb (Results 1 – 25 of 198) sorted by relevance

12345678

/external/strace/
Dxmalloc.c63 xcalloc(size_t nmemb, size_t size) in xcalloc() argument
65 void *p = calloc(nmemb, size); in xcalloc()
76 xreallocarray(void *ptr, size_t nmemb, size_t size) in xreallocarray() argument
78 size_t bytes = nmemb * size; in xreallocarray()
80 if ((nmemb | size) >= HALF_SIZE_T && in xreallocarray()
81 size && bytes / size != nmemb) in xreallocarray()
93 xgrowarray(void *const ptr, size_t *const nmemb, const size_t memb_size) in xgrowarray() argument
101 grow_memb = *nmemb ? 0 : in xgrowarray()
104 grow_memb = (*nmemb >> 1) + 1; in xgrowarray()
106 if ((*nmemb + grow_memb) < *nmemb) in xgrowarray()
[all …]
Dnumber_set.c107 clear_number_set_array(struct number_set *const set, const unsigned int nmemb) in clear_number_set_array() argument
111 for (i = 0; i < nmemb; ++i) { in clear_number_set_array()
120 invert_number_set_array(struct number_set *const set, const unsigned int nmemb) in invert_number_set_array() argument
124 for (i = 0; i < nmemb; ++i) in invert_number_set_array()
129 alloc_number_set_array(const unsigned int nmemb) in alloc_number_set_array() argument
131 return xcalloc(nmemb, sizeof(struct number_set)); in alloc_number_set_array()
135 free_number_set_array(struct number_set *const set, unsigned int nmemb) in free_number_set_array() argument
137 while (nmemb) { in free_number_set_array()
138 --nmemb; in free_number_set_array()
139 free(set[nmemb].vec); in free_number_set_array()
[all …]
Dnetlink_packet_diag.c121 const size_t nmemb = len / sizeof(dml); in decode_packet_diag_mclist() local
123 if (!nmemb) in decode_packet_diag_mclist()
126 print_array(tcp, addr, nmemb, &dml, sizeof(dml), in decode_packet_diag_mclist()
163 const unsigned int nmemb = len / sizeof(struct sock_filter); in decode_packet_diag_filter() local
164 if (!nmemb || (unsigned short) nmemb != nmemb) in decode_packet_diag_filter()
167 print_sock_fprog(tcp, addr, nmemb); in decode_packet_diag_filter()
Dnumber_set.h51 clear_number_set_array(struct number_set *, unsigned int nmemb);
54 invert_number_set_array(struct number_set *, unsigned int nmemb);
57 alloc_number_set_array(unsigned int nmemb) ATTRIBUTE_MALLOC;
60 free_number_set_array(struct number_set *, unsigned int nmemb);
Dxmalloc.h42 void *xcalloc(size_t nmemb, size_t size)
45 void *xreallocarray(void *ptr, size_t nmemb, size_t size)
63 void *xgrowarray(void *ptr, size_t *nmemb, size_t memb_size);
/external/python/cpython3/Modules/_decimal/libmpdec/
Dmemory.c48 void *(* mpd_callocfunc)(size_t nmemb, size_t size) = calloc;
54 mpd_callocfunc_em(size_t nmemb, size_t size) in mpd_callocfunc_em() argument
62 if (nmemb > MPD_SIZE_MAX || size > MPD_SIZE_MAX) { in mpd_callocfunc_em()
67 req = mul_size_t_overflow((mpd_size_t)nmemb, (mpd_size_t)size, in mpd_callocfunc_em()
86 mpd_alloc(mpd_size_t nmemb, mpd_size_t size) in mpd_alloc() argument
90 req = mul_size_t_overflow(nmemb, size, &overflow); in mpd_alloc()
100 mpd_calloc(mpd_size_t nmemb, mpd_size_t size) in mpd_calloc() argument
104 (void)mul_size_t_overflow(nmemb, size, &overflow); in mpd_calloc()
109 return mpd_callocfunc(nmemb, size); in mpd_calloc()
114 mpd_realloc(void *ptr, mpd_size_t nmemb, mpd_size_t size, uint8_t *err) in mpd_realloc() argument
[all …]
/external/openssh/
Dxmalloc.c53 xcalloc(size_t nmemb, size_t size) in xcalloc() argument
57 if (size == 0 || nmemb == 0) in xcalloc()
59 if (SIZE_MAX / nmemb < size) in xcalloc()
61 ptr = calloc(nmemb, size); in xcalloc()
64 size * nmemb); in xcalloc()
69 xreallocarray(void *ptr, size_t nmemb, size_t size) in xreallocarray() argument
73 new_ptr = reallocarray(ptr, nmemb, size); in xreallocarray()
76 nmemb, size); in xreallocarray()
/external/curl/tests/libtest/
Dlib1509.c28 size_t WriteOutput(void *ptr, size_t size, size_t nmemb, void *stream);
29 size_t WriteHeader(void *ptr, size_t size, size_t nmemb, void *stream);
83 size_t WriteOutput(void *ptr, size_t size, size_t nmemb, void *stream) in WriteOutput() argument
85 fwrite(ptr, size, nmemb, stream); in WriteOutput()
86 return nmemb * size; in WriteOutput()
89 size_t WriteHeader(void *ptr, size_t size, size_t nmemb, void *stream) in WriteHeader() argument
94 realHeaderSize += curlx_uztoul(size * nmemb); in WriteHeader()
96 return nmemb * size; in WriteHeader()
Dlib1540.c57 static size_t header_callback(void *ptr, size_t size, size_t nmemb, in header_callback() argument
60 size_t len = size * nmemb; in header_callback()
62 (void)fwrite(ptr, size, nmemb, stdout); in header_callback()
66 static size_t write_callback(void *ptr, size_t size, size_t nmemb, void *userp) in write_callback() argument
69 size_t len = size * nmemb; in write_callback()
74 fwrite(ptr, size, nmemb, stdout); in write_callback()
/external/webp/src/utils/
Dutils.c168 static int CheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) { in CheckSizeArgumentsOverflow() argument
169 const uint64_t total_size = nmemb * size; in CheckSizeArgumentsOverflow()
170 if (nmemb == 0) return 1; in CheckSizeArgumentsOverflow()
171 if ((uint64_t)size > WEBP_MAX_ALLOCABLE_MEMORY / nmemb) return 0; in CheckSizeArgumentsOverflow()
191 void* WebPSafeMalloc(uint64_t nmemb, size_t size) { in WebPSafeMalloc() argument
194 if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL; in WebPSafeMalloc()
195 assert(nmemb * size > 0); in WebPSafeMalloc()
196 ptr = malloc((size_t)(nmemb * size)); in WebPSafeMalloc()
197 AddMem(ptr, (size_t)(nmemb * size)); in WebPSafeMalloc()
201 void* WebPSafeCalloc(uint64_t nmemb, size_t size) { in WebPSafeCalloc() argument
[all …]
/external/aac/libSYS/src/
DgenericStds.cpp336 UINT FDKfwrite(const void *ptrf, INT size, UINT nmemb, FDKFILE *fp) { in FDKfwrite() argument
337 return (UINT)fwrite(ptrf, size, nmemb, (FILE *)fp); in FDKfwrite()
339 UINT FDKfread(void *dst, INT size, UINT nmemb, FDKFILE *fp) { in FDKfread() argument
340 return (UINT)fread(dst, size, nmemb, (FILE *)fp); in FDKfread()
347 UINT FDKfwrite_EL(const void *ptrf, INT size, UINT nmemb, FDKFILE *fp) { in FDKfwrite_EL() argument
349 FDKfwrite(ptrf, size, nmemb, fp); in FDKfwrite_EL()
356 for (n = 0; n < nmemb; n++) { in FDKfwrite_EL()
363 return nmemb; in FDKfwrite_EL()
366 UINT FDKfread_EL(void *dst, INT size, UINT nmemb, FDKFILE *fp) { in FDKfread_EL() argument
374 for (n = 0; n < nmemb; n++) { in FDKfread_EL()
[all …]
/external/giflib/
Dopenbsd-reallocarray.c30 reallocarray(void *optr, size_t nmemb, size_t size) in reallocarray() argument
32 if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && in reallocarray()
33 nmemb > 0 && SIZE_MAX / nmemb < size) { in reallocarray()
37 return realloc(optr, size * nmemb); in reallocarray()
/external/openssh/openbsd-compat/
Dreallocarray.c37 reallocarray(void *optr, size_t nmemb, size_t size) in reallocarray() argument
39 if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && in reallocarray()
40 nmemb > 0 && SIZE_MAX / nmemb < size) { in reallocarray()
44 return realloc(optr, size * nmemb); in reallocarray()
Dbsd-poll.c46 size_t nmemb; in poll() local
58 nmemb = howmany(maxfd + 1 , NFDBITS); in poll()
59 if ((readfds = calloc(nmemb, sizeof(fd_mask))) == NULL || in poll()
60 (writefds = calloc(nmemb, sizeof(fd_mask))) == NULL || in poll()
61 (exceptfds = calloc(nmemb, sizeof(fd_mask))) == NULL) { in poll()
/external/compiler-rt/lib/asan/
Dasan_malloc_win.cc80 void *calloc(size_t nmemb, size_t size) { in calloc() argument
82 return asan_calloc(nmemb, size, &stack); in calloc()
86 void *_calloc_base(size_t nmemb, size_t size) { in _calloc_base() argument
87 return calloc(nmemb, size); in _calloc_base()
91 void *_calloc_dbg(size_t nmemb, size_t size, int, const char *, int) { in _calloc_dbg() argument
92 return calloc(nmemb, size); in _calloc_dbg()
96 void *_calloc_impl(size_t nmemb, size_t size, int *errno_tmp) { in _calloc_impl() argument
97 return calloc(nmemb, size); in _calloc_impl()
/external/curl/docs/examples/
Dftpuploadresume.c32 static size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, in getcontentlengthfunc() argument
42 return size * nmemb; in getcontentlengthfunc()
46 static size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream) in discardfunc() argument
50 return size * nmemb; in discardfunc()
54 static size_t readfunc(void *ptr, size_t size, size_t nmemb, void *stream) in readfunc() argument
62 n = fread(ptr, size, nmemb, f) * size; in readfunc()
Dftp-wildcard.c39 static size_t write_it(char *buff, size_t size, size_t nmemb,
141 static size_t write_it(char *buff, size_t size, size_t nmemb, in write_it() argument
147 written = fwrite(buff, size, nmemb, data->output); in write_it()
150 written = fwrite(buff, size, nmemb, stdout); in write_it()
Dcurlgtk.c22 size_t my_write_func(void *ptr, size_t size, size_t nmemb, FILE *stream) in my_write_func() argument
24 return fwrite(ptr, size, nmemb, stream); in my_write_func()
27 size_t my_read_func(void *ptr, size_t size, size_t nmemb, FILE *stream) in my_read_func() argument
29 return fread(ptr, size, nmemb, stream); in my_read_func()
/external/pdfium/third_party/libtiff/
D0008-HeapBufferOverflow-ChopUpSingleUncompressedStrip.patch9 - if (nmemb && elem_size && !_TIFFIfMultiplicationOverflow(nmemb, elem_size))
10 + if (nmemb > 0 && elem_size > 0 && !_TIFFIfMultiplicationOverflow(nmemb, elem_size))
Dtif_aux.c64 tmsize_t nmemb, tmsize_t elem_size, const char* what) in _TIFFCheckRealloc() argument
67 tmsize_t bytes = nmemb * elem_size; in _TIFFCheckRealloc()
72 if (nmemb > 0 && elem_size > 0 && !_TIFFIfMultiplicationOverflow(nmemb, elem_size)) in _TIFFCheckRealloc()
79 what,(long) nmemb, (long) elem_size); in _TIFFCheckRealloc()
86 _TIFFCheckMalloc(TIFF* tif, tmsize_t nmemb, tmsize_t elem_size, const char* what) in _TIFFCheckMalloc() argument
88 return _TIFFCheckRealloc(tif, NULL, nmemb, elem_size, what); in _TIFFCheckMalloc()
/external/wpa_supplicant_8/src/utils/
Dos.h277 static inline void * os_calloc(size_t nmemb, size_t size) in os_calloc() argument
279 if (size && nmemb > (~(size_t) 0) / size) in os_calloc()
281 return os_zalloc(nmemb * size); in os_calloc()
565 static inline void * os_realloc_array(void *ptr, size_t nmemb, size_t size) in os_realloc_array() argument
567 if (size && nmemb > (~(size_t) 0) / size) in os_realloc_array()
569 return os_realloc(ptr, nmemb * size); in os_realloc_array()
579 static inline void os_remove_in_array(void *ptr, size_t nmemb, size_t size, in os_remove_in_array() argument
582 if (idx < nmemb - 1) in os_remove_in_array()
585 (nmemb - idx - 1) * size); in os_remove_in_array()
/external/libvpx/libvpx/vpx_mem/
Dvpx_mem.c29 static int check_size_argument_overflow(uint64_t nmemb, uint64_t size) { in check_size_argument_overflow() argument
30 const uint64_t total_size = nmemb * size; in check_size_argument_overflow()
31 if (nmemb == 0) return 1; in check_size_argument_overflow()
32 if (size > VPX_MAX_ALLOCABLE_MEMORY / nmemb) return 0; in check_size_argument_overflow()
/external/libaom/libaom/aom_mem/
Daom_mem.c21 static int check_size_argument_overflow(uint64_t nmemb, uint64_t size) { in check_size_argument_overflow() argument
22 const uint64_t total_size = nmemb * size; in check_size_argument_overflow()
23 if (nmemb == 0) return 1; in check_size_argument_overflow()
24 if (size > AOM_MAX_ALLOCABLE_MEMORY / nmemb) return 0; in check_size_argument_overflow()
/external/libldac/src/
Dmemory_ldac.c39 size_t nmemb, in calloc_ldac() argument
46 p_sfinfo->p_mempos += nmemb * align_ldac(size); in calloc_ldac()
49 p_tmp = calloc(nmemb, size); in calloc_ldac()
/external/libaom/libaom/common/
Drawenc.c31 unsigned int nmemb) { in write_file() argument
32 fwrite(buffer, size, nmemb, (FILE *)fp); in write_file()
36 unsigned int nmemb) { in write_md5() argument
37 MD5Update((MD5Context *)md5, buffer, size * nmemb); in write_md5()

12345678