/third_party/node/deps/ngtcp2/nghttp3/lib/ |
D | nghttp3_ringbuf.c | 46 int nghttp3_ringbuf_init(nghttp3_ringbuf *rb, size_t nmemb, size_t size, in nghttp3_ringbuf_init() argument 48 if (nmemb) { in nghttp3_ringbuf_init() 50 assert(1 == __popcnt((unsigned int)nmemb)); in nghttp3_ringbuf_init() 52 assert(1 == __builtin_popcount((unsigned int)nmemb)); in nghttp3_ringbuf_init() 55 rb->buf = nghttp3_mem_malloc(mem, nmemb * size); in nghttp3_ringbuf_init() 64 rb->nmemb = nmemb; in nghttp3_ringbuf_init() 81 rb->first = (rb->first - 1) & (rb->nmemb - 1); in nghttp3_ringbuf_push_front() 82 rb->len = nghttp3_min(rb->nmemb, rb->len + 1); in nghttp3_ringbuf_push_front() 88 size_t offset = (rb->first + rb->len) & (rb->nmemb - 1); in nghttp3_ringbuf_push_back() 90 if (rb->len == rb->nmemb) { in nghttp3_ringbuf_push_back() [all …]
|
D | nghttp3_mem.c | 43 static void *default_calloc(size_t nmemb, size_t size, void *user_data) { in default_calloc() argument 46 return calloc(nmemb, size); in default_calloc() 69 void *nghttp3_mem_calloc(const nghttp3_mem *mem, size_t nmemb, size_t size) { in nghttp3_mem_calloc() argument 70 return mem->calloc(nmemb, size, mem->user_data); in nghttp3_mem_calloc() 103 void *nghttp3_mem_calloc_debug(const nghttp3_mem *mem, size_t nmemb, in nghttp3_mem_calloc_debug() argument 106 void *nptr = mem->calloc(nmemb, size, mem->user_data); in nghttp3_mem_calloc_debug() 108 fprintf(stderr, "calloc %p nmemb=%zu size=%zu in %s at %s:%zu\n", nptr, nmemb, in nghttp3_mem_calloc_debug()
|
/third_party/node/deps/ngtcp2/ngtcp2/lib/ |
D | ngtcp2_ringbuf.c | 44 int ngtcp2_ringbuf_init(ngtcp2_ringbuf *rb, size_t nmemb, size_t size, in ngtcp2_ringbuf_init() argument 46 uint8_t *buf = ngtcp2_mem_malloc(mem, nmemb * size); in ngtcp2_ringbuf_init() 51 ngtcp2_ringbuf_buf_init(rb, nmemb, size, buf, mem); in ngtcp2_ringbuf_init() 56 void ngtcp2_ringbuf_buf_init(ngtcp2_ringbuf *rb, size_t nmemb, size_t size, in ngtcp2_ringbuf_buf_init() argument 59 assert(1 == __popcnt((unsigned int)nmemb)); in ngtcp2_ringbuf_buf_init() 61 assert(1 == __builtin_popcount((unsigned int)nmemb)); in ngtcp2_ringbuf_buf_init() 66 rb->nmemb = nmemb; in ngtcp2_ringbuf_buf_init() 81 rb->first = (rb->first - 1) & (rb->nmemb - 1); in ngtcp2_ringbuf_push_front() 82 rb->len = ngtcp2_min(rb->nmemb, rb->len + 1); in ngtcp2_ringbuf_push_front() 88 size_t offset = (rb->first + rb->len) & (rb->nmemb - 1); in ngtcp2_ringbuf_push_back() [all …]
|
D | ngtcp2_mem.c | 42 static void *default_calloc(size_t nmemb, size_t size, void *user_data) { in default_calloc() argument 45 return calloc(nmemb, size); in default_calloc() 68 void *ngtcp2_mem_calloc(const ngtcp2_mem *mem, size_t nmemb, size_t size) { in ngtcp2_mem_calloc() argument 69 return mem->calloc(nmemb, size, mem->user_data); in ngtcp2_mem_calloc() 93 void *ngtcp2_mem_calloc_debug(const ngtcp2_mem *mem, size_t nmemb, size_t size, in ngtcp2_mem_calloc_debug() argument 95 void *nptr = mem->calloc(nmemb, size, mem->user_data); in ngtcp2_mem_calloc_debug() 97 fprintf(stderr, "calloc %p nmemb=%zu size=%zu in %s at %s:%zu\n", nptr, nmemb, in ngtcp2_mem_calloc_debug()
|
/third_party/skia/third_party/externals/libwebp/src/utils/ |
D | utils.c | 171 static int CheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) { in CheckSizeArgumentsOverflow() argument 172 const uint64_t total_size = nmemb * size; in CheckSizeArgumentsOverflow() 173 if (nmemb == 0) return 1; in CheckSizeArgumentsOverflow() 174 if ((uint64_t)size > WEBP_MAX_ALLOCABLE_MEMORY / nmemb) return 0; in CheckSizeArgumentsOverflow() 194 void* WebPSafeMalloc(uint64_t nmemb, size_t size) { in WebPSafeMalloc() argument 197 if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL; in WebPSafeMalloc() 198 assert(nmemb * size > 0); in WebPSafeMalloc() 199 ptr = malloc((size_t)(nmemb * size)); in WebPSafeMalloc() 200 AddMem(ptr, (size_t)(nmemb * size)); in WebPSafeMalloc() 204 void* WebPSafeCalloc(uint64_t nmemb, size_t size) { in WebPSafeCalloc() argument [all …]
|
/third_party/curl/tests/libtest/ |
D | lib1509.c | 30 size_t WriteOutput(void *ptr, size_t size, size_t nmemb, void *stream); 31 size_t WriteHeader(void *ptr, size_t size, size_t nmemb, void *stream); 85 size_t WriteOutput(void *ptr, size_t size, size_t nmemb, void *stream) in WriteOutput() argument 87 fwrite(ptr, size, nmemb, stream); in WriteOutput() 88 return nmemb * size; in WriteOutput() 91 size_t WriteHeader(void *ptr, size_t size, size_t nmemb, void *stream) in WriteHeader() argument 96 realHeaderSize += curlx_uztoul(size * nmemb); in WriteHeader() 98 return nmemb * size; in WriteHeader()
|
D | lib1540.c | 59 static size_t header_callback(void *ptr, size_t size, size_t nmemb, in header_callback() argument 62 size_t len = size * nmemb; in header_callback() 64 (void)fwrite(ptr, size, nmemb, stdout); in header_callback() 68 static size_t write_callback(void *ptr, size_t size, size_t nmemb, void *userp) in write_callback() argument 71 size_t len = size * nmemb; in write_callback() 76 fwrite(ptr, size, nmemb, stdout); in write_callback()
|
/third_party/mesa3d/src/util/ |
D | u_qsort.h | 35 void util_tls_qsort_r(void *base, size_t nmemb, size_t size, 55 util_qsort_r(void *base, size_t nmemb, size_t size, in util_qsort_r() argument 68 qsort_r(base, nmemb, size, &data, util_qsort_adapter); in util_qsort_r() 71 qsort_r(base, nmemb, size, compar, arg); in util_qsort_r() 82 qsort_s(base, nmemb, size, util_qsort_adapter, &data); in util_qsort_r() 85 qsort_s(base, nmemb, size, compar, arg); in util_qsort_r() 89 util_tls_qsort_r(base, nmemb, size, compar, arg); in util_qsort_r()
|
D | reallocarray.h | 44 reallocarray(void *optr, size_t nmemb, size_t size) in reallocarray() argument 46 if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && in reallocarray() 47 nmemb > 0 && SIZE_MAX / nmemb < size) { in reallocarray() 51 return realloc(optr, size * nmemb); in reallocarray()
|
/third_party/python/Modules/_decimal/libmpdec/ |
D | mpalloc.c | 52 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 64 req = mul_size_t_overflow((mpd_size_t)nmemb, (mpd_size_t)size, in mpd_callocfunc_em() 83 mpd_alloc(mpd_size_t nmemb, mpd_size_t size) in mpd_alloc() argument 87 req = mul_size_t_overflow(nmemb, size, &overflow); in mpd_alloc() 97 mpd_calloc(mpd_size_t nmemb, mpd_size_t size) in mpd_calloc() argument 101 (void)mul_size_t_overflow(nmemb, size, &overflow); in mpd_calloc() 106 return mpd_callocfunc(nmemb, size); in mpd_calloc() 111 mpd_realloc(void *ptr, mpd_size_t nmemb, mpd_size_t size, uint8_t *err) in mpd_realloc() argument 116 req = mul_size_t_overflow(nmemb, size, &overflow); in mpd_realloc() [all …]
|
/third_party/curl/docs/examples/ |
D | ftpuploadresume.c | 34 static size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, in getcontentlengthfunc() argument 44 return size * nmemb; in getcontentlengthfunc() 48 static size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream) in discardfunc() argument 52 return size * nmemb; in discardfunc() 56 static size_t readfunc(char *ptr, size_t size, size_t nmemb, void *stream) in readfunc() argument 64 n = fread(ptr, size, nmemb, f) * size; in readfunc()
|
D | imap-append.c | 62 static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) in payload_source() argument 66 size_t room = size * nmemb; in payload_source() 68 if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { in payload_source()
|
/third_party/skia/third_party/externals/microhttpd/src/testcurl/ |
D | test_timeout.c | 87 putBuffer (void *stream, size_t size, size_t nmemb, void *ptr) in putBuffer() argument 92 wrt = size * nmemb; in putBuffer() 102 putBuffer_fail (void *stream, size_t size, size_t nmemb, void *ptr) in putBuffer_fail() argument 109 copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) in copyBuffer() argument 113 if (cbc->pos + size * nmemb > cbc->size) in copyBuffer() 115 memcpy (&cbc->buf[cbc->pos], ptr, size * nmemb); in copyBuffer() 116 cbc->pos += size * nmemb; in copyBuffer() 117 return size * nmemb; in copyBuffer()
|
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/utils/ |
D | os.h | 278 static inline void * os_calloc(size_t nmemb, size_t size) in os_calloc() argument 280 if (size && nmemb > (~(size_t) 0) / size) in os_calloc() 282 return os_zalloc(nmemb * size); in os_calloc() 566 static inline void * os_realloc_array(void *ptr, size_t nmemb, size_t size) in os_realloc_array() argument 568 if (size && nmemb > (~(size_t) 0) / size) in os_realloc_array() 570 return os_realloc(ptr, nmemb * size); in os_realloc_array() 580 static inline void os_remove_in_array(void *ptr, size_t nmemb, size_t size, in os_remove_in_array() argument 583 if (idx < nmemb - 1) in os_remove_in_array() 586 (nmemb - idx - 1) * size); in os_remove_in_array()
|
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/utils/ |
D | os.h | 278 static inline void * os_calloc(size_t nmemb, size_t size) in os_calloc() argument 280 if (size && nmemb > (~(size_t) 0) / size) in os_calloc() 282 return os_zalloc(nmemb * size); in os_calloc() 566 static inline void * os_realloc_array(void *ptr, size_t nmemb, size_t size) in os_realloc_array() argument 568 if (size && nmemb > (~(size_t) 0) / size) in os_realloc_array() 570 return os_realloc(ptr, nmemb * size); in os_realloc_array() 580 static inline void os_remove_in_array(void *ptr, size_t nmemb, size_t size, in os_remove_in_array() argument 583 if (idx < nmemb - 1) in os_remove_in_array() 586 (nmemb - idx - 1) * size); in os_remove_in_array()
|
/third_party/musl/porting/uniproton/kernel/src/stdio/ |
D | fread.c | 6 size_t fread(void *restrict destv, size_t size, size_t nmemb, FILE *restrict f) in fread() argument 9 size_t len = size*nmemb, l = len, k; in fread() 10 if (!size) nmemb = 0; in fread() 35 return nmemb; in fread()
|
D | fwrite.c | 28 size_t fwrite(const void *restrict src, size_t size, size_t nmemb, FILE *restrict f) in fwrite() argument 30 size_t k, l = size*nmemb; in fwrite() 31 if (!size) nmemb = 0; in fwrite() 35 return k==l ? nmemb : k/size; in fwrite()
|
/third_party/musl/porting/liteos_a/kernel/src/stdio/ |
D | fread.c | 6 size_t fread(void *restrict destv, size_t size, size_t nmemb, FILE *restrict f) in fread() argument 9 size_t len = size*nmemb, l = len, k; in fread() 10 if (!size) nmemb = 0; in fread() 35 return nmemb; in fread()
|
D | fwrite.c | 28 size_t fwrite(const void *restrict src, size_t size, size_t nmemb, FILE *restrict f) in fwrite() argument 30 size_t k, l = size*nmemb; in fwrite() 31 if (!size) nmemb = 0; in fwrite() 35 return k==l ? nmemb : k/size; in fwrite()
|
/third_party/musl/porting/liteos_m/kernel/src/stdio/ |
D | fread.c | 6 size_t fread(void *restrict destv, size_t size, size_t nmemb, FILE *restrict f) in fread() argument 9 size_t len = size*nmemb, l = len, k; in fread() 10 if (!size) nmemb = 0; in fread() 35 return nmemb; in fread()
|
D | fwrite.c | 28 size_t fwrite(const void *restrict src, size_t size, size_t nmemb, FILE *restrict f) in fwrite() argument 30 size_t k, l = size*nmemb; in fwrite() 31 if (!size) nmemb = 0; in fwrite() 35 return k==l ? nmemb : k/size; in fwrite()
|
/third_party/ffmpeg/libavutil/ |
D | mem.c | 207 void *av_malloc_array(size_t nmemb, size_t size) in av_malloc_array() argument 210 if (size_mult(nmemb, size, &result) < 0) in av_malloc_array() 216 void *av_mallocz_array(size_t nmemb, size_t size) in av_mallocz_array() argument 219 if (size_mult(nmemb, size, &result) < 0) in av_mallocz_array() 225 void *av_realloc_array(void *ptr, size_t nmemb, size_t size) in av_realloc_array() argument 228 if (size_mult(nmemb, size, &result) < 0) in av_realloc_array() 233 int av_reallocp_array(void *ptr, size_t nmemb, size_t size) in av_reallocp_array() argument 238 val = av_realloc_f(val, nmemb, size); in av_reallocp_array() 240 if (!val && nmemb && size) in av_reallocp_array() 272 void *av_calloc(size_t nmemb, size_t size) in av_calloc() argument [all …]
|
/third_party/nghttp2/lib/ |
D | nghttp2_mem.c | 39 static void *default_calloc(size_t nmemb, size_t size, void *mem_user_data) { in default_calloc() argument 42 return calloc(nmemb, size); in default_calloc() 68 void *nghttp2_mem_calloc(nghttp2_mem *mem, size_t nmemb, size_t size) { in nghttp2_mem_calloc() argument 69 return mem->calloc(nmemb, size, mem->mem_user_data); in nghttp2_mem_calloc()
|
/third_party/musl/src/stdio/ |
D | fwrite.c | 31 size_t fwrite(const void *restrict src, size_t size, size_t nmemb, FILE *restrict f) in fwrite() argument 36 size_t k, l = size*nmemb; in fwrite() 37 if (!size) nmemb = 0; in fwrite() 41 return k==l ? nmemb : k/size; in fwrite()
|
/third_party/node/deps/nghttp2/lib/ |
D | nghttp2_mem.c | 39 static void *default_calloc(size_t nmemb, size_t size, void *mem_user_data) { in default_calloc() argument 42 return calloc(nmemb, size); in default_calloc() 68 void *nghttp2_mem_calloc(nghttp2_mem *mem, size_t nmemb, size_t size) { in nghttp2_mem_calloc() argument 69 return mem->calloc(nmemb, size, mem->mem_user_data); in nghttp2_mem_calloc()
|