Home
last modified time | relevance | path

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

1234567891011

/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);
/external/openssh/
Dxmalloc.c47 xcalloc(size_t nmemb, size_t size) in xcalloc() argument
51 if (size == 0 || nmemb == 0) in xcalloc()
53 if (SIZE_MAX / nmemb < size) in xcalloc()
55 ptr = calloc(nmemb, size); in xcalloc()
58 size * nmemb); in xcalloc()
63 xreallocarray(void *ptr, size_t nmemb, size_t size) in xreallocarray() argument
67 new_ptr = reallocarray(ptr, nmemb, size); in xreallocarray()
70 nmemb, size); in xreallocarray()
75 xrecallocarray(void *ptr, size_t onmemb, size_t nmemb, size_t size) in xrecallocarray() argument
79 new_ptr = recallocarray(ptr, onmemb, nmemb, size); in xrecallocarray()
[all …]
/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/python/cpython3/Modules/_decimal/libmpdec/
Dmpalloc.c52 void *(* mpd_callocfunc)(size_t nmemb, size_t size) = calloc;
58 mpd_callocfunc_em(size_t nmemb, size_t size) in mpd_callocfunc_em() argument
66 if (nmemb > MPD_SIZE_MAX || size > MPD_SIZE_MAX) { in mpd_callocfunc_em()
71 req = mul_size_t_overflow((mpd_size_t)nmemb, (mpd_size_t)size, in mpd_callocfunc_em()
90 mpd_alloc(mpd_size_t nmemb, mpd_size_t size) in mpd_alloc() argument
94 req = mul_size_t_overflow(nmemb, size, &overflow); in mpd_alloc()
104 mpd_calloc(mpd_size_t nmemb, mpd_size_t size) in mpd_calloc() argument
108 (void)mul_size_t_overflow(nmemb, size, &overflow); in mpd_calloc()
113 return mpd_callocfunc(nmemb, size); in mpd_calloc()
118 mpd_realloc(void *ptr, mpd_size_t nmemb, mpd_size_t size, uint8_t *err) in mpd_realloc() argument
[all …]
/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/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-malloc.c37 rpl_calloc(size_t nmemb, size_t size) in rpl_calloc() argument
39 if (nmemb == 0) in rpl_calloc()
40 nmemb = 1; in rpl_calloc()
43 return calloc(nmemb, size); in rpl_calloc()
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/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/llvm-project/llvm/test/Transforms/InstSimplify/
Ddiv-by-0-guard-before-smul_ov.ll6 define i1 @t0_smul(i4 %size, i4 %nmemb) {
13 %smul = tail call { i4, i1 } @llvm.smul.with.overflow.i4(i4 %size, i4 %nmemb)
19 define i1 @t1_commutative(i4 %size, i4 %nmemb) {
26 %smul = tail call { i4, i1 } @llvm.smul.with.overflow.i4(i4 %size, i4 %nmemb)
32 define i1 @n2_wrong_size(i4 %size0, i4 %size1, i4 %nmemb) {
41 %smul = tail call { i4, i1 } @llvm.smul.with.overflow.i4(i4 %size0, i4 %nmemb)
47 define i1 @n3_wrong_pred(i4 %size, i4 %nmemb) {
56 %smul = tail call { i4, i1 } @llvm.smul.with.overflow.i4(i4 %size, i4 %nmemb)
62 define i1 @n4_not_and(i4 %size, i4 %nmemb) {
71 %smul = tail call { i4, i1 } @llvm.smul.with.overflow.i4(i4 %size, i4 %nmemb)
[all …]
Ddiv-by-0-guard-before-umul_ov.ll6 define i1 @t0_umul(i4 %size, i4 %nmemb) {
13 %umul = tail call { i4, i1 } @llvm.umul.with.overflow.i4(i4 %size, i4 %nmemb)
19 define i1 @t1_commutative(i4 %size, i4 %nmemb) {
26 %umul = tail call { i4, i1 } @llvm.umul.with.overflow.i4(i4 %size, i4 %nmemb)
32 define i1 @n2_wrong_size(i4 %size0, i4 %size1, i4 %nmemb) {
41 %umul = tail call { i4, i1 } @llvm.umul.with.overflow.i4(i4 %size0, i4 %nmemb)
47 define i1 @n3_wrong_pred(i4 %size, i4 %nmemb) {
56 %umul = tail call { i4, i1 } @llvm.umul.with.overflow.i4(i4 %size, i4 %nmemb)
62 define i1 @n4_not_and(i4 %size, i4 %nmemb) {
71 %umul = tail call { i4, i1 } @llvm.umul.with.overflow.i4(i4 %size, i4 %nmemb)
[all …]
Ddiv-by-0-guard-before-umul_ov-not.ll6 define i1 @t0_umul(i4 %size, i4 %nmemb) {
14 %umul = tail call { i4, i1 } @llvm.umul.with.overflow.i4(i4 %size, i4 %nmemb)
21 define i1 @t1_commutative(i4 %size, i4 %nmemb) {
29 %umul = tail call { i4, i1 } @llvm.umul.with.overflow.i4(i4 %size, i4 %nmemb)
36 define i1 @n2_wrong_size(i4 %size0, i4 %size1, i4 %nmemb) {
46 %umul = tail call { i4, i1 } @llvm.umul.with.overflow.i4(i4 %size0, i4 %nmemb)
53 define i1 @n3_wrong_pred(i4 %size, i4 %nmemb) {
63 %umul = tail call { i4, i1 } @llvm.umul.with.overflow.i4(i4 %size, i4 %nmemb)
70 define i1 @n4_not_and(i4 %size, i4 %nmemb) {
80 %umul = tail call { i4, i1 } @llvm.umul.with.overflow.i4(i4 %size, i4 %nmemb)
[all …]
Ddiv-by-0-guard-before-smul_ov-not.ll6 define i1 @t0_umul(i4 %size, i4 %nmemb) {
14 %smul = tail call { i4, i1 } @llvm.smul.with.overflow.i4(i4 %size, i4 %nmemb)
21 define i1 @t1_commutative(i4 %size, i4 %nmemb) {
29 %smul = tail call { i4, i1 } @llvm.smul.with.overflow.i4(i4 %size, i4 %nmemb)
36 define i1 @n2_wrong_size(i4 %size0, i4 %size1, i4 %nmemb) {
46 %smul = tail call { i4, i1 } @llvm.smul.with.overflow.i4(i4 %size0, i4 %nmemb)
53 define i1 @n3_wrong_pred(i4 %size, i4 %nmemb) {
63 %smul = tail call { i4, i1 } @llvm.smul.with.overflow.i4(i4 %size, i4 %nmemb)
70 define i1 @n4_not_and(i4 %size, i4 %nmemb) {
80 %smul = tail call { i4, i1 } @llvm.smul.with.overflow.i4(i4 %size, i4 %nmemb)
[all …]
/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()
/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/perfetto/src/profiling/memory/
Dwrap_allocators.cc43 size_t nmemb, in wrap_calloc() argument
45 void* addr = fn(nmemb, size); in wrap_calloc()
47 nmemb * size); in wrap_calloc()
126 size_t nmemb, in wrap_reallocarray() argument
130 void* addr = fn(pointer, nmemb, size); in wrap_reallocarray()
132 nmemb * size); in wrap_reallocarray()
/external/llvm-project/compiler-rt/lib/lsan/
Dlsan_allocator.cpp107 static void *Calloc(uptr nmemb, uptr size, const StackTrace &stack) { in Calloc() argument
108 if (UNLIKELY(CheckForCallocOverflow(size, nmemb))) { in Calloc()
111 ReportCallocOverflow(nmemb, size, &stack); in Calloc()
113 size *= nmemb; in Calloc()
195 void *lsan_reallocarray(void *ptr, uptr nmemb, uptr size, in lsan_reallocarray() argument
197 if (UNLIKELY(CheckForCallocOverflow(size, nmemb))) { in lsan_reallocarray()
201 ReportReallocArrayOverflow(nmemb, size, &stack); in lsan_reallocarray()
203 return lsan_realloc(ptr, nmemb * size, stack); in lsan_reallocarray()
206 void *lsan_calloc(uptr nmemb, uptr size, const StackTrace &stack) { in lsan_calloc() argument
207 return SetErrnoOnNull(Calloc(nmemb, size, stack)); in lsan_calloc()
/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()

1234567891011