/bionic/libc/bionic/ |
D | new.cpp | 26 void* operator new(std::size_t size) { in operator new() argument 27 void* p = malloc(size); in operator new() 29 async_safe_fatal("new failed to allocate %zu bytes", size); in operator new() 34 void* operator new[](std::size_t size) { in operator new[]() argument 35 void* p = malloc(size); in operator new[]() 37 async_safe_fatal("new[] failed to allocate %zu bytes", size); in operator new[]() 50 void* operator new(std::size_t size, const std::nothrow_t&) { in operator new() argument 51 return malloc(size); in operator new() 54 void* operator new[](std::size_t size, const std::nothrow_t&) { in operator new[]() argument 55 return malloc(size); in operator new[]()
|
D | getcwd.cpp | 34 extern "C" int __getcwd(char* buf, size_t size); 36 char* getcwd(char* buf, size_t size) { in getcwd() argument 38 if (buf != NULL && size == 0) { in getcwd() 45 size_t allocated_size = size; in getcwd() 47 if (size == 0) { in getcwd() 70 if (size == 0) { in getcwd()
|
D | mmap.cpp | 44 void* mmap64(void* addr, size_t size, int prot, int flags, int fd, off64_t offset) { in mmap64() argument 51 size_t rounded = __BIONIC_ALIGN(size, PAGE_SIZE); in mmap64() 52 if (rounded < size || rounded > PTRDIFF_MAX) { in mmap64() 61 void* result = __mmap2(addr, size, prot, flags, fd, offset >> MMAP2_SHIFT); in mmap64() 66 int rc = madvise(result, size, MADV_MERGEABLE); in mmap64() 75 void* mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset) { in mmap() argument 76 return mmap64(addr, size, prot, flags, fd, static_cast<off64_t>(offset)); in mmap()
|
D | android_set_abort_message.cpp | 41 size_t size; member 62 size_t size = sizeof(abort_msg_t) + strlen(msg) + 1; in android_set_abort_message() local 63 void* map = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); in android_set_abort_message() 69 new_abort_message->size = size; in android_set_abort_message()
|
D | jemalloc_wrapper.cpp | 26 size_t size = __BIONIC_ALIGN(bytes, pagesize); in je_pvalloc() local 27 if (size < bytes) { in je_pvalloc() 30 return je_memalign(pagesize, size); in je_pvalloc() 40 void* je_memalign_round_up_boundary(size_t boundary, size_t size) { in je_memalign_round_up_boundary() argument 48 return je_memalign(boundary, size); in je_memalign_round_up_boundary()
|
D | flistxattr.cpp | 40 ssize_t flistxattr(int fd, char *list, size_t size) { in flistxattr() argument 42 ssize_t result = ___flistxattr(fd, list, size); in flistxattr() 57 return listxattr(FdPath(fd).c_str(), list, size); in flistxattr()
|
D | fgetxattr.cpp | 40 ssize_t fgetxattr(int fd, const char *name, void *value, size_t size) { in fgetxattr() argument 42 ssize_t result = ___fgetxattr(fd, name, value, size); in fgetxattr() 58 return getxattr(FdPath(fd).c_str(), name, value, size); in fgetxattr()
|
D | fsetxattr.cpp | 40 int fsetxattr(int fd, const char* name, const void* value, size_t size, int flags) { in fsetxattr() argument 42 int result = ___fsetxattr(fd, name, value, size, flags); in fsetxattr() 57 return setxattr(FdPath(fd).c_str(), name, value, size, flags); in fsetxattr()
|
/bionic/libc/include/bits/fortify/ |
D | stdio.h | 41 int vsnprintf(char* const __pass_object_size dest, size_t size, const char* format, va_list ap) in vsnprintf() argument 43 return __builtin___vsnprintf_chk(dest, size, 0, __bos(dest), format, ap); in vsnprintf() 59 int snprintf(char* dest, size_t size, const char* format) 67 int snprintf(char* const __pass_object_size dest, size_t size, const char* format, ...) in snprintf() argument 71 int result = __builtin___vsnprintf_chk(dest, size, 0, __bos(dest), format, va); in snprintf() 96 size_t fread(void* const __pass_object_size0 buf, size_t size, size_t count, FILE* stream) in fread() argument 98 __clang_error_if(__unsafe_check_mul_overflow(size, count), in fread() 100 __clang_error_if(__bos(buf) != __BIONIC_FORTIFY_UNKNOWN_SIZE && size * count > __bos(buf), in fread() 105 return __call_bypassing_fortify(fread)(buf, size, count, stream); in fread() 107 return __fread_chk(buf, size, count, stream, bos); in fread() [all …]
|
D | unistd.h | 72 char* getcwd(char* const __pass_object_size buf, size_t size) in getcwd() argument 74 __error_if_overflows_objectsize(size, __bos(buf), getcwd) { in getcwd() 78 return __call_bypassing_fortify(getcwd)(buf, size); in getcwd() 81 return __getcwd_chk(buf, size, bos); in getcwd() 179 ssize_t readlink(const char* path, char* const __pass_object_size buf, size_t size) in readlink() argument 181 __error_if_overflows_ssizet(size, readlink) in readlink() 182 __error_if_overflows_objectsize(size, __bos(buf), readlink) { in readlink() 186 return __call_bypassing_fortify(readlink)(path, buf, size); in readlink() 189 return __readlink_chk(path, buf, size, bos); in readlink() 193 ssize_t readlinkat(int dirfd, const char* path, char* const __pass_object_size buf, size_t size) in readlinkat() argument [all …]
|
/bionic/libc/kernel/uapi/asm-generic/ |
D | ioctl.h | 46 #define _IOC(dir,type,nr,size) (((dir) << _IOC_DIRSHIFT) | ((type) << _IOC_TYPESHIFT) | ((nr) << _I… argument 49 #define _IOR(type,nr,size) _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size))) argument 50 #define _IOW(type,nr,size) _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size))) argument 51 #define _IOWR(type,nr,size) _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size))) argument 52 #define _IOR_BAD(type,nr,size) _IOC(_IOC_READ, (type), (nr), sizeof(size)) argument 53 #define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE, (type), (nr), sizeof(size)) argument 54 #define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), sizeof(size)) argument
|
/bionic/libc/malloc_hooks/ |
D | malloc_hooks.cpp | 59 void* hooks_malloc(size_t size); 67 int hooks_posix_memalign(void** memptr, size_t alignment, size_t size); 68 int hooks_iterate(uintptr_t base, size_t size, 69 void (*callback)(uintptr_t base, size_t size, void* arg), void* arg); 75 void* hooks_valloc(size_t size); 125 void* hooks_malloc(size_t size) { in hooks_malloc() argument 127 return __malloc_hook(size, __builtin_return_address(0)); in hooks_malloc() 129 return g_dispatch->malloc(size); in hooks_malloc() 155 size_t size; in hooks_calloc() local 156 if (__builtin_mul_overflow(nmemb, bytes, &size)) { in hooks_calloc() [all …]
|
/bionic/libc/upstream-openbsd/lib/libc/stdio/ |
D | setvbuf.c | 43 setvbuf(FILE *fp, char *buf, int mode, size_t size) in setvbuf() argument 55 if ((mode != _IOFBF && mode != _IOLBF) || (int)size < 0) in setvbuf() 86 if (size == 0) { in setvbuf() 88 size = iosize; in setvbuf() 93 if ((buf = malloc(size)) == NULL) { in setvbuf() 99 if (size != iosize) { in setvbuf() 100 size = iosize; in setvbuf() 101 buf = malloc(size); in setvbuf() 130 if (size != iosize) in setvbuf() 140 fp->_bf._size = size; in setvbuf() [all …]
|
D | fgetwc.c | 43 size_t size; in __fgetwc_unlock() local 70 size = mbrtowc(&wc, &c, 1, st); in __fgetwc_unlock() 71 if (size == (size_t)-1) { in __fgetwc_unlock() 75 } while (size == (size_t)-2); in __fgetwc_unlock()
|
/bionic/libc/upstream-openbsd/lib/libc/stdlib/ |
D | reallocarray.c | 30 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()
|
/bionic/libc/stdio/ |
D | fmemopen.cpp | 43 size_t size; member 51 if (static_cast<size_t>(n) > ck->size - ck->offset) n = ck->size - ck->offset; in fmemopen_read() 68 if (ck->append) ck->offset = ck->size; in fmemopen_write() 84 if (ck->offset >= ck->size) { in fmemopen_write() 86 ck->size = ck->offset; in fmemopen_write() 99 } else if (whence == SEEK_END && (offset <= 0 && static_cast<size_t>(-offset) <= ck->size)) { in fmemopen_seek() 100 return (ck->offset = ck->size + offset); in fmemopen_seek() 143 ck->size = strnlen(ck->buf, ck->capacity); in fmemopen() 144 ck->offset = ck->size; in fmemopen() 147 ck->size = capacity; in fmemopen() [all …]
|
/bionic/libc/upstream-netbsd/lib/libc/stdlib/ |
D | reallocarr.c | 57 reallocarr(void *ptr, size_t number, size_t size) in __weak_alias() 65 if (number == 0 || size == 0) { in __weak_alias() 79 if (__predict_false((number|size) >= SQRT_SIZE_MAX && in __weak_alias() 80 number > SIZE_MAX / size)) { in __weak_alias() 85 nptr = realloc(optr, number * size); in __weak_alias()
|
/bionic/libc/upstream-openbsd/lib/libc/net/ |
D | inet_ntop.c | 33 static const char *inet_ntop4(const u_char *src, char *dst, size_t size); 34 static const char *inet_ntop6(const u_char *src, char *dst, size_t size); 45 inet_ntop(int af, const void *src, char *dst, socklen_t size) in inet_ntop() argument 49 return (inet_ntop4(src, dst, size)); in inet_ntop() 51 return (inet_ntop6(src, dst, size)); in inet_ntop() 72 inet_ntop4(const u_char *src, char *dst, size_t size) in inet_ntop4() argument 79 if (l <= 0 || l >= size) { in inet_ntop4() 83 strlcpy(dst, tmp, size); in inet_ntop4() 94 inet_ntop6(const u_char *src, char *dst, size_t size) in inet_ntop6() argument 199 if ((size_t)(tp - tmp) > size) { in inet_ntop6() [all …]
|
/bionic/libc/malloc_debug/ |
D | malloc_debug.cpp | 77 void* debug_malloc(size_t size); 79 void* debug_aligned_alloc(size_t alignment, size_t size); 85 int debug_posix_memalign(void** memptr, size_t alignment, size_t size); 86 int debug_iterate(uintptr_t base, size_t size, 87 void (*callback)(uintptr_t base, size_t size, void* arg), void* arg); 93 void* debug_valloc(size_t size); 132 size_t num_frames = backtrace_get(frames.data(), frames.size()); in LogError() 176 static void* InitHeader(Header* header, void* orig_pointer, size_t size) { in InitHeader() argument 179 header->size = size; in InitHeader() 198 header->usable_size = header->size; in InitHeader() [all …]
|
/bionic/libc/include/ |
D | alloca.h | 34 #define alloca(size) __builtin_alloca(size) argument
|
/bionic/libc/kernel/uapi/linux/ |
D | bcache.h | 22 #define BITMASK(name,type,field,offset,size) static inline __u64 name(const type * k) \ argument 23 { return(k->field >> offset) & ~(~0ULL << size); } static inline void SET_ ##name(type * k, __u64 v… 24 { k->field &= ~(~(~0ULL << size) << offset); k->field |= (v & ~(~0ULL << size)) << offset; \ 31 #define KEY_FIELD(name,field,offset,size) BITMASK(name, struct bkey, field, offset, size) argument 32 #define PTR_FIELD(name,offset,size) static inline __u64 name(const struct bkey * k, unsigned i) \ argument 33 { return(k->ptr[i] >> offset) & ~(~0ULL << size); } static inline void SET_ ##name(struct bkey * k,… 34 { k->ptr[i] &= ~(~(~0ULL << size) << offset); k->ptr[i] |= (v & ~(~0ULL << size)) << offset; \ 38 #define KEY(inode,offset,size) \ argument 39 ((struct bkey) {.high = (1ULL << 63) | ((__u64) (size) << 20) | (inode),.low = (offset) \
|
/bionic/tests/ |
D | sched_test.cpp | 169 size_t size = CPU_ALLOC_SIZE(17); in TEST() local 171 CPU_ZERO_S(size, set); in TEST() 172 ASSERT_EQ(0, CPU_COUNT_S(size, set)); in TEST() 173 CPU_SET_S(16, size, set); in TEST() 174 ASSERT_TRUE(CPU_ISSET_S(16, size, set)); in TEST() 181 size_t size = CPU_ALLOC_SIZE(10 * CPU_SETSIZE); in TEST() local 183 CPU_ZERO_S(size, set); in TEST() 184 ASSERT_EQ(0, CPU_COUNT_S(size, set)); in TEST() 185 CPU_SET_S(CPU_SETSIZE, size, set); in TEST() 186 ASSERT_TRUE(CPU_ISSET_S(CPU_SETSIZE, size, set)); in TEST() [all …]
|
/bionic/libc/dns/resolv/ |
D | res_debug.h | 25 # define DprintQ(cond, args, query, size) /*empty*/ argument 30 # define DprintQ(cond, args, query, size) if (cond) {\ argument 32 res_pquery(statp, query, size, stdout);\
|
/bionic/libc/kernel/uapi/asm-arm/asm/ |
D | setup.h | 25 __u32 size; member 36 __u32 size; member 54 __u32 size; member 61 __u32 size; member 124 …er_present(tag,member) ((unsigned long) (& ((struct tag *) 0L)->member + 1) <= (tag)->hdr.size * 4) 125 #define tag_next(t) ((struct tag *) ((__u32 *) (t) + (t)->hdr.size)) 127 #define for_each_tag(t,base) for(t = base; t->hdr.size; t = tag_next(t))
|
/bionic/linker/ |
D | linker_mapped_file_fragment.cpp | 48 bool MappedFileFragment::Map(int fd, off64_t base_offset, size_t elf_offset, size_t size) { in Map() argument 55 CHECK(safe_add(&end_offset, offset, size)); in Map() 59 CHECK(map_size >= size); in Map() 72 size_ = size; in Map()
|