Home
last modified time | relevance | path

Searched refs:bytes (Results 1 – 25 of 48) sorted by relevance

12

/bionic/tests/
Duchar_test.cpp62 char bytes[MB_LEN_MAX]; in TEST() local
63 EXPECT_EQ(1U, c16rtomb(bytes, L'\0', nullptr)); in TEST()
67 char bytes[MB_LEN_MAX]; in TEST() local
69 memset(bytes, 0, sizeof(bytes)); in TEST()
70 EXPECT_EQ(1U, c16rtomb(bytes, L'h', nullptr)); in TEST()
71 EXPECT_EQ('h', bytes[0]); in TEST()
77 memset(bytes, 0, sizeof(bytes)); in TEST()
78 EXPECT_EQ(1U, c16rtomb(bytes, L'h', nullptr)); in TEST()
79 EXPECT_EQ('h', bytes[0]); in TEST()
81 memset(bytes, 0, sizeof(bytes)); in TEST()
[all …]
Dwchar_test.cpp38 char bytes[] = { 'h', 'e', 'l', 'l', 'o', '\0' }; in TEST() local
39 EXPECT_EQ(0U, mbrlen(&bytes[0], 0, nullptr)); in TEST()
40 EXPECT_EQ(1U, mbrlen(&bytes[0], 1, nullptr)); in TEST()
42 EXPECT_EQ(1U, mbrlen(&bytes[4], 1, nullptr)); in TEST()
43 EXPECT_EQ(0U, mbrlen(&bytes[5], 1, nullptr)); in TEST()
53 char bytes[MB_LEN_MAX]; in TEST() local
56 EXPECT_EQ(1, wctomb(bytes, L'\0')); in TEST()
57 EXPECT_EQ(1U, wcrtomb(bytes, L'\0', nullptr)); in TEST()
60 memset(bytes, 0, sizeof(bytes)); in TEST()
61 EXPECT_EQ(1, wctomb(bytes, L'h')); in TEST()
[all …]
Darpa_inet_test.cpp249 const unsigned char bytes[] = {0x01, 0x00, 0x02, 0x0e, 0xf0, 0x20}; in TEST() local
251 ASSERT_EQ(dst, inet_nsap_ntoa(6, bytes, dst)); in TEST()
261 const unsigned char bytes[] = {0x01, 0x00, 0x02, 0x0e, 0xf0, 0x20}; in TEST() local
262 ASSERT_STREQ("0x01.0002.0EF0.20", inet_nsap_ntoa(6, bytes, nullptr)); in TEST()
Dmalloc_test.cpp1181 EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return calloc(bytes, 1) != nullptr; }), in TEST() argument
1183 EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return calloc(1, bytes) != nullptr; }), in TEST() argument
1185 EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return malloc(bytes) != nullptr; }), in TEST() argument
1188 [](size_t bytes) { return memalign(sizeof(void*), bytes) != nullptr; }), in TEST() argument
1190 EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { in TEST() argument
1192 return posix_memalign(&ptr, sizeof(void *), bytes) == 0; in TEST()
1196 [](size_t bytes) { return aligned_alloc(sizeof(void*), bytes) != nullptr; }), in TEST() argument
1198 EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { in TEST() argument
1200 return realloc(p, bytes) != nullptr; in TEST()
1204 EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return pvalloc(bytes) != nullptr; }), in TEST() argument
[all …]
/bionic/libc/arch-x86/string/
Dsse4-memcmp-slm.S177 jz L(0bytes)
184 jz L(0bytes)
191 jz L(0bytes)
198 jz L(0bytes)
205 jz L(0bytes)
209 je L(0bytes)
222 L(0bytes):
324 L(16bytes):
329 L(12bytes):
334 L(8bytes):
[all …]
Dssse3-memcmp-atom.S1834 je L(8bytes)
1837 je L(9bytes)
1839 je L(10bytes)
1841 je L(11bytes)
1843 je L(12bytes)
1845 je L(13bytes)
1847 je L(14bytes)
1848 jmp L(15bytes)
1850 jmp L(12bytes)
1853 je L(10bytes)
[all …]
/bionic/libc/bionic/
Dmalloc_limit.cpp49 static void* LimitMalloc(size_t bytes);
50 static void* LimitMemalign(size_t alignment, size_t bytes);
52 static void* LimitRealloc(void* old_mem, size_t bytes);
55 static void* LimitPvalloc(size_t bytes);
56 static void* LimitValloc(size_t bytes);
96 static inline bool CheckLimit(size_t bytes) { in CheckLimit() argument
99 atomic_load_explicit(&gAllocated, memory_order_relaxed), bytes, &total) || in CheckLimit()
137 void* LimitMalloc(size_t bytes) { in LimitMalloc() argument
138 if (!CheckLimit(bytes)) { in LimitMalloc()
139 warning_log("malloc_limit: malloc(%zu) exceeds limit %" PRId64, bytes, gAllocLimit); in LimitMalloc()
[all …]
Dmalloc_common.cpp121 extern "C" void* malloc(size_t bytes) { in malloc() argument
125 result = dispatch_table->malloc(bytes); in malloc()
127 result = Malloc(malloc)(bytes); in malloc()
130 warning_log("malloc(%zu) failed: returning null pointer", bytes); in malloc()
145 extern "C" void* memalign(size_t alignment, size_t bytes) { in memalign() argument
148 return MaybeTagPointer(dispatch_table->memalign(alignment, bytes)); in memalign()
150 void* result = Malloc(memalign)(alignment, bytes); in memalign()
152 warning_log("memalign(%zu, %zu) failed: returning null pointer", alignment, bytes); in memalign()
183 extern "C" __attribute__((__noinline__)) void* realloc(void* old_mem, size_t bytes) { in realloc() argument
187 return MaybeTagPointer(dispatch_table->realloc(old_mem, bytes)); in realloc()
[all …]
Dgwp_asan_wrappers.cpp75 size_t bytes; in gwp_asan_calloc() local
76 if (!__builtin_mul_overflow(n_elements, elem_size, &bytes)) { in gwp_asan_calloc()
77 if (void* result = GuardedAlloc.allocate(bytes)) { in gwp_asan_calloc()
93 void* gwp_asan_malloc(size_t bytes) { in gwp_asan_malloc() argument
95 if (void* result = GuardedAlloc.allocate(bytes)) { in gwp_asan_malloc()
99 return prev_dispatch->malloc(bytes); in gwp_asan_malloc()
109 void* gwp_asan_realloc(void* old_mem, size_t bytes) { in gwp_asan_realloc() argument
115 if (__predict_false(bytes == 0)) { in gwp_asan_realloc()
119 void* new_ptr = gwp_asan_malloc(bytes); in gwp_asan_realloc()
124 memcpy(new_ptr, old_mem, (bytes < old_size) ? bytes : old_size); in gwp_asan_realloc()
[all …]
Djemalloc_wrapper.cpp26 void* je_pvalloc(size_t bytes) { in je_pvalloc() argument
28 size_t size = __BIONIC_ALIGN(bytes, pagesize); in je_pvalloc()
29 if (size < bytes) { in je_pvalloc()
Dbionic_elf_tls.cpp227 size_t bytes = dtv_size_in_bytes(MAX(1, loaded_cnt)); in calculate_new_dtv_count() local
228 if (!powerof2(bytes)) { in calculate_new_dtv_count()
229 bytes = BIONIC_ROUND_UP_POWER_OF_2(bytes); in calculate_new_dtv_count()
231 return (bytes - sizeof(TlsDtv)) / sizeof(void*); in calculate_new_dtv_count()
Dmalloc_heapprofd.cpp398 extern "C" void* MallocInitHeapprofdHook(size_t bytes) { in MallocInitHeapprofdHook() argument
433 return previous_dispatch->malloc(bytes); in MallocInitHeapprofdHook()
435 return NativeAllocatorDispatch()->malloc(bytes); in MallocInitHeapprofdHook()
/bionic/libc/arch-x86_64/string/
Dsse4-memcmp-slm.S753 jnc L(16bytes)
758 jnc L(16bytes)
763 jnc L(16bytes)
767 jmp L(16bytes)
772 jmp L(16bytes)
776 jmp L(16bytes)
780 jmp L(16bytes)
784 jmp L(16bytes)
788 jmp L(16bytes)
792 jmp L(16bytes)
[all …]
/bionic/libc/malloc_hooks/
Dmalloc_hooks.cpp63 void* hooks_memalign(size_t alignment, size_t bytes);
64 void* hooks_aligned_alloc(size_t alignment, size_t bytes);
65 void* hooks_realloc(void* pointer, size_t bytes);
66 void* hooks_calloc(size_t nmemb, size_t bytes);
77 void* hooks_pvalloc(size_t bytes);
81 static void* default_malloc_hook(size_t bytes, const void*) { in default_malloc_hook() argument
82 return g_dispatch->malloc(bytes); in default_malloc_hook()
85 static void* default_realloc_hook(void* pointer, size_t bytes, const void*) { in default_realloc_hook() argument
86 return g_dispatch->realloc(pointer, bytes); in default_realloc_hook()
93 static void* default_memalign_hook(size_t alignment, size_t bytes, const void*) { in default_memalign_hook() argument
[all …]
/bionic/libc/malloc_debug/
Dmalloc_debug.cpp187 void* debug_memalign(size_t alignment, size_t bytes);
188 void* debug_realloc(void* pointer, size_t bytes);
189 void* debug_calloc(size_t nmemb, size_t bytes);
200 void* debug_pvalloc(size_t bytes);
565 size_t bytes = InternalMallocUsableSize(pointer); in InternalMalloc() local
567 bytes = (bytes < fill_bytes) ? bytes : fill_bytes; in InternalMalloc()
568 memset(pointer, g_debug->config().fill_alloc_value(), bytes); in InternalMalloc()
603 size_t bytes; in InternalFree() local
622 bytes = header->usable_size; in InternalFree()
624 bytes = g_dispatch->malloc_usable_size(pointer); in InternalFree()
[all …]
/bionic/libc/upstream-netbsd/lib/libc/isc/
Dev_streams.c49 static void consume(evStream *str, size_t bytes);
233 consume(evStream *str, size_t bytes) { in consume() argument
234 while (bytes > 0U) { in consume()
235 if (bytes < (size_t)str->iovCur->iov_len) { in consume()
236 str->iovCur->iov_len -= bytes; in consume()
238 ((u_char *)str->iovCur->iov_base + bytes); in consume()
239 str->ioDone += bytes; in consume()
240 bytes = 0; in consume()
242 bytes -= str->iovCur->iov_len; in consume()
272 int bytes; in writable() local
[all …]
/bionic/libc/kernel/uapi/linux/netfilter/
Dxt_sctp.h45 #define bytes(type) (sizeof(type) * 8) macro
46 …e SCTP_CHUNKMAP_SET(chunkmap,type) do { (chunkmap)[type / bytes(__u32)] |= 1u << (type % bytes(__u…
47 …CTP_CHUNKMAP_CLEAR(chunkmap,type) do { (chunkmap)[type / bytes(__u32)] &= ~(1u << (type % bytes(__…
49 ({ ((chunkmap)[type / bytes(__u32)] & (1u << (type % bytes(__u32)))) ? 1 : 0; \
Dxt_set.h65 struct ip_set_counter_match0 bytes; member
78 struct ip_set_counter_match bytes; member
/bionic/libc/stdio/
Dvfscanf.cpp348 size_t bytes = 0; in __svfscanf() local
350 if (bytes == MB_CUR_MAX) { in __svfscanf()
354 buf[bytes++] = *fp->_p; in __svfscanf()
358 nconv = mbrtowc(wcp, buf, bytes, &mbs); in __svfscanf()
365 nread += bytes; in __svfscanf()
368 bytes = 0; in __svfscanf()
371 if (bytes != 0) { in __svfscanf()
437 size_t bytes = 0; in __svfscanf() local
439 if (bytes == MB_CUR_MAX) { in __svfscanf()
443 buf[bytes++] = *fp->_p; in __svfscanf()
[all …]
/bionic/linker/
Dlinker_block_allocator.cpp45 uint8_t bytes[kAllocateSize - 16] __attribute__((aligned(16))); member
93 ssize_t offset = reinterpret_cast<uint8_t*>(block) - page->bytes; in free()
126 FreeBlockInfo* first_block = reinterpret_cast<FreeBlockInfo*>(page->bytes); in create_new_page()
128 first_block->num_free_blocks = sizeof(page->bytes) / block_size_; in create_new_page()
/bionic/libc/upstream-openbsd/lib/libc/crypt/
Dchacha_private.h89 chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes) in chacha_encrypt_bytes() argument
97 if (!bytes) return; in chacha_encrypt_bytes()
117 if (bytes < 64) { in chacha_encrypt_bytes()
118 for (i = 0;i < bytes;++i) tmp[i] = m[i]; in chacha_encrypt_bytes()
208 if (bytes <= 64) { in chacha_encrypt_bytes()
209 if (bytes < 64) { in chacha_encrypt_bytes()
210 for (i = 0;i < bytes;++i) ctarget[i] = c[i]; in chacha_encrypt_bytes()
216 bytes -= 64; in chacha_encrypt_bytes()
/bionic/benchmarks/tests/
Dinterface_test.cpp127 ssize_t bytes = TEMP_FAILURE_RETRY(read(fd_, buffer, sizeof(buffer) - 1)); in RunTest() local
128 if (bytes == -1 && errno == EAGAIN) { in RunTest()
131 ASSERT_NE(-1, bytes); in RunTest()
132 if (bytes == 0) { in RunTest()
135 buffer[bytes] = '\0'; in RunTest()
/bionic/libc/kernel/uapi/mtd/
Dubi-user.h69 __s64 bytes; member
77 __s64 bytes; member
92 __s32 bytes; member
/bionic/benchmarks/
Dmalloc_rss_benchmark.cpp57 void dirtyMem(void* ptr, size_t bytes) { in dirtyMem() argument
58 memset(ptr, 1U, bytes); in dirtyMem()
/bionic/libc/kernel/uapi/linux/
Dgen_stats.h36 __u64 bytes; member

12