Home
last modified time | relevance | path

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

12

/bionic/tests/
Duchar_test.cpp113 char bytes[MB_LEN_MAX]; in TEST() local
114 EXPECT_EQ(1U, c16rtomb(bytes, L'\0', nullptr)); in TEST()
118 char bytes[MB_LEN_MAX]; in TEST() local
120 memset(bytes, 0, sizeof(bytes)); in TEST()
121 EXPECT_EQ(1U, c16rtomb(bytes, L'h', nullptr)); in TEST()
122 EXPECT_EQ('h', bytes[0]); in TEST()
128 memset(bytes, 0, sizeof(bytes)); in TEST()
129 EXPECT_EQ(1U, c16rtomb(bytes, L'h', nullptr)); in TEST()
130 EXPECT_EQ('h', bytes[0]); in TEST()
132 memset(bytes, 0, sizeof(bytes)); in TEST()
[all …]
Dwchar_test.cpp69 char bytes[] = { 'h', 'e', 'l', 'l', 'o', '\0' }; in TEST() local
70 EXPECT_EQ(static_cast<size_t>(-2), mbrlen(&bytes[0], 0, nullptr)); in TEST()
71 EXPECT_EQ(1U, mbrlen(&bytes[0], 1, nullptr)); in TEST()
73 EXPECT_EQ(1U, mbrlen(&bytes[4], 1, nullptr)); in TEST()
74 EXPECT_EQ(0U, mbrlen(&bytes[5], 1, nullptr)); in TEST()
84 char bytes[MB_LEN_MAX]; in TEST() local
87 EXPECT_EQ(1, wctomb(bytes, L'\0')); in TEST()
88 EXPECT_EQ(1U, wcrtomb(bytes, L'\0', nullptr)); in TEST()
91 memset(bytes, 0, sizeof(bytes)); in TEST()
92 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.cpp1191 EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return calloc(bytes, 1) != nullptr; }), in TEST() argument
1193 EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return calloc(1, bytes) != nullptr; }), in TEST() argument
1195 EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return malloc(bytes) != nullptr; }), in TEST() argument
1198 [](size_t bytes) { return memalign(sizeof(void*), bytes) != nullptr; }), in TEST() argument
1200 EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { in TEST() argument
1202 return posix_memalign(&ptr, sizeof(void *), bytes) == 0; in TEST()
1206 [](size_t bytes) { return aligned_alloc(sizeof(void*), bytes) != nullptr; }), in TEST() argument
1208 EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { in TEST() argument
1210 return realloc(p, bytes) != nullptr; in TEST()
1214 EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return pvalloc(bytes) != nullptr; }), in TEST() argument
[all …]
/bionic/libc/bionic/
Dmalloc_limit.cpp50 static void* LimitMalloc(size_t bytes);
51 static void* LimitMemalign(size_t alignment, size_t bytes);
53 static void* LimitRealloc(void* old_mem, size_t bytes);
56 static void* LimitPvalloc(size_t bytes);
57 static void* LimitValloc(size_t bytes);
97 static inline bool CheckLimit(size_t bytes) { in CheckLimit() argument
100 atomic_load_explicit(&gAllocated, memory_order_relaxed), bytes, &total) || in CheckLimit()
138 void* LimitMalloc(size_t bytes) { in LimitMalloc() argument
139 if (!CheckLimit(bytes)) { in LimitMalloc()
140 warning_log("malloc_limit: malloc(%zu) exceeds limit %" PRId64, bytes, gAllocLimit); in LimitMalloc()
[all …]
Dnetinet_ether.cpp34 int bytes[ETHER_ADDR_LEN], end; in ether_aton_r() local
36 &bytes[0], &bytes[1], &bytes[2], in ether_aton_r()
37 &bytes[3], &bytes[4], &bytes[5], &end); in ether_aton_r()
40 if (bytes[i] > 0xff) return NULL; in ether_aton_r()
41 addr->ether_addr_octet[i] = bytes[i]; in ether_aton_r()
Dmalloc_common.cpp136 extern "C" void* malloc(size_t bytes) { in malloc() argument
140 result = dispatch_table->malloc(bytes); in malloc()
142 result = Malloc(malloc)(bytes); in malloc()
145 warning_log("malloc(%zu) failed: returning null pointer", bytes); in malloc()
160 extern "C" void* memalign(size_t alignment, size_t bytes) { in memalign() argument
163 return MaybeTagPointer(dispatch_table->memalign(alignment, bytes)); in memalign()
165 void* result = Malloc(memalign)(alignment, bytes); in memalign()
167 warning_log("memalign(%zu, %zu) failed: returning null pointer", alignment, bytes); in memalign()
198 extern "C" __attribute__((__noinline__)) void* realloc(void* old_mem, size_t bytes) { in realloc() argument
202 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.cpp36 void* je_pvalloc(size_t bytes) { in je_pvalloc() argument
38 size_t size = __BIONIC_ALIGN(bytes, pagesize); in je_pvalloc()
39 if (size < bytes) { in je_pvalloc()
Dbionic_elf_tls.cpp292 size_t bytes = dtv_size_in_bytes(MAX(1, loaded_cnt)); in calculate_new_dtv_count() local
293 if (!powerof2(bytes)) { in calculate_new_dtv_count()
294 bytes = BIONIC_ROUND_UP_POWER_OF_2(bytes); in calculate_new_dtv_count()
296 return (bytes - sizeof(TlsDtv)) / sizeof(void*); in calculate_new_dtv_count()
/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/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/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/kernel/uapi/linux/netfilter/
Dxt_sctp.h33 #define bytes(type) (sizeof(type) * 8) macro
34 …e SCTP_CHUNKMAP_SET(chunkmap,type) do { (chunkmap)[type / bytes(__u32)] |= 1u << (type % bytes(__u…
35 …CTP_CHUNKMAP_CLEAR(chunkmap,type) do { (chunkmap)[type / bytes(__u32)] &= ~(1u << (type % bytes(__…
37 ({ ((chunkmap)[type / bytes(__u32)] & (1u << (type % bytes(__u32)))) ? 1 : 0; \
Dxt_set.h53 struct ip_set_counter_match0 bytes; member
66 struct ip_set_counter_match bytes; member
/bionic/libc/malloc_debug/
Dmalloc_debug.cpp188 void* debug_memalign(size_t alignment, size_t bytes);
189 void* debug_realloc(void* pointer, size_t bytes);
190 void* debug_calloc(size_t nmemb, size_t bytes);
201 void* debug_pvalloc(size_t bytes);
570 size_t bytes = InternalMallocUsableSize(pointer); in InternalMalloc() local
572 bytes = (bytes < fill_bytes) ? bytes : fill_bytes; in InternalMalloc()
573 memset(pointer, g_debug->config().fill_alloc_value(), bytes); in InternalMalloc()
612 size_t bytes; in InternalFree() local
631 bytes = header->usable_size; in InternalFree()
633 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/stdio/
Dvfscanf.cpp319 size_t bytes = 0; in __svfscanf() local
321 if (bytes == MB_CUR_MAX) { in __svfscanf()
325 buf[bytes++] = *fp->_p; in __svfscanf()
329 nconv = mbrtowc(wcp, buf, bytes, &mbs); in __svfscanf()
336 nread += bytes; in __svfscanf()
339 bytes = 0; in __svfscanf()
342 if (bytes != 0) { in __svfscanf()
408 size_t bytes = 0; in __svfscanf() local
410 if (bytes == MB_CUR_MAX) { in __svfscanf()
414 buf[bytes++] = *fp->_p; in __svfscanf()
[all …]
/bionic/linker/
Dlinker_block_allocator.cpp46 uint8_t bytes[kAllocateSize - 16] __attribute__((aligned(16))); member
94 ssize_t offset = reinterpret_cast<uint8_t*>(block) - page->bytes; in free()
127 FreeBlockInfo* first_block = reinterpret_cast<FreeBlockInfo*>(page->bytes); in create_new_page()
129 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/libc/kernel/uapi/mtd/
Dubi-user.h58 __s64 bytes; member
66 __s64 bytes; member
81 __s32 bytes; member
/bionic/benchmarks/tests/
Dinterface_test.cpp124 ssize_t bytes = TEMP_FAILURE_RETRY(read(fd_, buffer, sizeof(buffer) - 1)); in RunTest() local
125 if (bytes == -1 && errno == EAGAIN) { in RunTest()
128 ASSERT_NE(-1, bytes); in RunTest()
129 if (bytes == 0) { in RunTest()
132 buffer[bytes] = '\0'; in RunTest()
/bionic/libc/kernel/uapi/linux/
Dgen_stats.h24 __u64 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()

12