/aosp14/frameworks/base/apct-tests/perftests/core/src/android/libcore/ |
H A D | SystemArrayCopyPerfTest.java | 50 final int len = arrayLength; in timeSystemCharArrayCopy() local 51 char[] src = new char[len]; in timeSystemCharArrayCopy() 52 char[] dst = new char[len]; in timeSystemCharArrayCopy() 62 final int len = arrayLength; in timeSystemByteArrayCopy() local 63 byte[] src = new byte[len]; in timeSystemByteArrayCopy() 64 byte[] dst = new byte[len]; in timeSystemByteArrayCopy() 74 final int len = arrayLength; in timeSystemShortArrayCopy() local 87 int[] src = new int[len]; in timeSystemIntArrayCopy() 88 int[] dst = new int[len]; in timeSystemIntArrayCopy() 99 long[] src = new long[len]; in timeSystemLongArrayCopy() [all …]
|
/aosp14/system/core/libsparse/ |
H A D | output_file.cpp | 87 int64_t len; member 150 while (len > 0) { in file_write() 161 len -= ret; in file_write() 214 if (ret >= len) { in gz_file_pad() 232 while (len > 0) { in gz_file_write() 238 len -= ret; in gz_file_write() 421 while (len) { in write_sparse_data_chunk() 436 while (len) { in write_sparse_data_chunk() 479 while (len) { in write_sparse_fd_chunk() 564 while (len) { in write_normal_fill_chunk() [all …]
|
H A D | sparse_read.cpp | 111 while (len) { in GetCrc32() 118 len -= chunk; in GetCrc32() 181 buf += len; in ReadValue() 182 offset += len; in ReadValue() 192 buf += len; in GetCrc32() 193 offset += len; in GetCrc32() 277 while (len) { in process_fill_chunk() 298 while (len) { in process_skip_chunk() 598 int64_t len; in sparse_file_import_source() local 670 int64_t len; in sparse_file_import_auto() local [all …]
|
H A D | sparse.cpp | 43 s->len = len; in sparse_file_new() 54 return backed_block_add_data(s->backed_block_list, data, len, block); in sparse_file_add_data() 63 uint64_t len, unsigned int block) { in sparse_file_add_file() argument 84 if (last_block < DIV_ROUND_UP(s->len, s->block_size)) { in sparse_count_chunks() 130 pad = s->len - (int64_t)last_block * s->block_size; in write_all_blocks() 232 *count += len; in out_counter_write() 279 len -= overhead; in move_chunks_up_to_len() 299 if (file_len + count > len) { in move_chunks_up_to_len() 306 if (!last_bb || (len - file_len > (len / 8))) { in move_chunks_up_to_len() 333 tmp = sparse_file_new(in_s->block_size, in_s->len); in sparse_file_resparse() [all …]
|
H A D | output_file.h | 28 struct output_file* output_file_open_fd(int fd, unsigned int block_size, int64_t len, int gz, 31 unsigned int block_size, int64_t len, int gz, 33 int write_data_chunk(struct output_file* out, uint64_t len, void* data); 34 int write_fill_chunk(struct output_file* out, uint64_t len, uint32_t fill_val); 35 int write_file_chunk(struct output_file* out, uint64_t len, const char* file, int64_t offset); 36 int write_fd_chunk(struct output_file* out, uint64_t len, int fd, int64_t offset); 37 int write_skip_chunk(struct output_file* out, uint64_t len); 40 int read_all(int fd, void* buf, size_t len);
|
H A D | backed_block.cpp | 28 uint64_t len; member 64 return bb->len; in backed_block_len() 193 block_len = a->len / bbl->block_size; /* rounds down */ in merge_bb() 222 a->len += b->len; in merge_bb() 281 bb->len = len; in backed_block_add_fill() 298 bb->len = len; in backed_block_add_data() 315 bb->len = len; in backed_block_add_file() 337 bb->len = len; in backed_block_add_fd() 352 if (bb->len <= max_len) { in backed_block_split() 363 new_bb->len = bb->len - max_len; in backed_block_split() [all …]
|
/aosp14/frameworks/base/core/java/com/android/internal/util/ |
H A D | LineBreakBufferedWriter.java | 141 len -= nextNewLine + 1; in write() 154 len -= rest; in write() 159 if (len > 0) { in write() 161 appendToBuffer(buf, off, len); in write() 195 len -= nextNewLine + 1; in write() 208 len -= rest; in write() 213 if (len > 0) { in write() 215 appendToBuffer(s, off, len); in write() 234 ensureCapacity(bufferIndex + len); in appendToBuffer() 237 bufferIndex += len; in appendToBuffer() [all …]
|
H A D | ArtFastDataOutput.java | 83 int len = CharsetUtils.toModifiedUtf8Bytes(s, mBufferPtr, mBufferPos + 2, mBufferCap); in writeUTF() local 84 if (Math.abs(len) > MAX_UNSIGNED_SHORT) { in writeUTF() 85 throw new IOException("Modified UTF-8 length too large: " + len); in writeUTF() 88 if (len >= 0) { in writeUTF() 91 writeShort(len); in writeUTF() 92 mBufferPos += len; in writeUTF() 96 len = -len; in writeUTF() 97 final byte[] tmp = (byte[]) mRuntime.newNonMovableArray(byte.class, len + 1); in writeUTF() 99 writeShort(len); in writeUTF() 100 write(tmp, 0, len); in writeUTF()
|
H A D | ArtFastDataInput.java | 82 final int len = readUnsignedShort(); in readUTF() local 83 if (mBufferCap > len) { in readUTF() 84 if (mBufferLim - mBufferPos < len) fill(len); in readUTF() 85 final String res = CharsetUtils.fromModifiedUtf8Bytes(mBufferPtr, mBufferPos, len); in readUTF() 86 mBufferPos += len; in readUTF() 89 final byte[] tmp = (byte[]) mRuntime.newNonMovableArray(byte.class, len + 1); in readUTF() 90 readFully(tmp, 0, len); in readUTF() 91 return CharsetUtils.fromModifiedUtf8Bytes(mRuntime.addressOf(tmp), 0, len); in readUTF()
|
/aosp14/system/core/libutils/ |
H A D | String8.cpp | 62 if (len > 0) { in allocFromUTF8() 71 str[len] = 0; in allocFromUTF8() 103 if (len == 0) { in allocFromUTF32() 386 size_t len = size(); in find() local 387 if (start >= len) { in find() 408 next = len; in removeAll() 442 if (len > 0 && buf[len - 1] == OS_PATH_SEPARATOR) len--; in setPathName() 443 buf[len] = '\0'; in setPathName() 556 if (len == 0) { in appendPath() 572 len += newlen; in appendPath() [all …]
|
/aosp14/frameworks/base/core/java/android/util/ |
H A D | Base64.java | 256 return len * 3/4 + 10; in maxOutputSize() 269 len += offset; in process() 282 while (p < len) { in process() 515 int output_len = len / 3 * 4; in encode() 519 if (len % 3 > 0) { in encode() 523 switch (len % 3) { in encode() 602 return len * 8/5 + 10; in maxOutputSize() 613 len += offset; in process() 664 while (p+3 <= len) { in process() 722 assert p == len; in process() local [all …]
|
H A D | Base64OutputStream.java | 101 public void write(byte[] b, int off, int len) throws IOException { in write() argument 102 if (len <= 0) return; in write() 104 internalWrite(b, off, len, false); in write() 141 private void internalWrite(byte[] b, int off, int len, boolean finish) throws IOException { in internalWrite() argument 142 coder.output = embiggen(coder.output, coder.maxOutputSize(len)); in internalWrite() 143 if (!coder.process(b, off, len, finish)) { in internalWrite() 153 private byte[] embiggen(byte[] b, int len) { in embiggen() argument 154 if (b == null || b.length < len) { in embiggen() 155 return new byte[len]; in embiggen()
|
/aosp14/system/core/libstats/push_compat/ |
H A D | stats_event_list.c | 71 ssize_t len; in stats_write_list() local 84 len = context->len = context->pos; in stats_write_list() 89 if (len < 0) { in stats_write_list() 90 len = 0; in stats_write_list() 99 vec[1].iov_len = len; in stats_write_list() 150 size_t len, i; in __write_to_stats_daemon() local 155 if (!len) { in __write_to_stats_daemon() 220 len = 0; in android_log_write_char_array() 226 if (len <= 0) { in android_log_write_char_array() 234 if (len) { in android_log_write_char_array() [all …]
|
/aosp14/system/core/fastboot/ |
H A D | usb_linux.cpp | 161 len -= dev->bLength; in filter_usb_device() 167 len -= cfg->bLength; in filter_usb_device() 211 while (len > 0) { in filter_usb_device() 219 if (len <= 0) in filter_usb_device() 416 xfer = (len > MAX_USBFS_BULK_SIZE) ? MAX_USBFS_BULK_SIZE : len; in Write() 419 bulk.len = xfer; in Write() 431 len -= xfer; in Write() 433 } while(len > 0); in Write() 449 while (len > 0) { in Read() 450 int xfer = (len > MAX_USBFS_BULK_SIZE) ? MAX_USBFS_BULK_SIZE : len; in Read() [all …]
|
H A D | usb_windows.cpp | 74 ssize_t Read(void* data, size_t len) override; 75 ssize_t Write(const void* data, size_t len) override; 162 DBG("usb_write %zu\n", len); in Write() 165 while(len > 0) { in Write() 166 int xfer = (len > MAX_USBFS_BULK_SIZE) ? MAX_USBFS_BULK_SIZE : len; in Write() 179 len -= written; in Write() 182 if (len == 0) in Write() 201 DBG("usb_read %zu\n", len); in Read() 203 while (len > 0) { in Read() 204 size_t xfer = (len > MAX_USBFS_BULK_SIZE) ? MAX_USBFS_BULK_SIZE : len; in Read() [all …]
|
/aosp14/frameworks/base/tools/aapt2/format/binary/ |
H A D | XmlFlattener_test.cpp | 298 size_t len; in TEST_F() local 367 size_t len; in TEST_F() local 383 EXPECT_THAT(tree.getText(&len), StrEq(u" A ")); in TEST_F() 389 EXPECT_THAT(tree.getText(&len), StrEq(u"B ")); in TEST_F() 395 EXPECT_THAT(tree.getText(&len), StrEq(u"C ")); in TEST_F() 401 EXPECT_THAT(tree.getText(&len), StrEq(u" D ")); in TEST_F() 407 EXPECT_THAT(tree.getText(&len), StrEq(u" E")); in TEST_F() 413 EXPECT_THAT(tree.getText(&len), StrEq(u" F")); in TEST_F() 419 EXPECT_THAT(tree.getText(&len), StrEq(u" G ")); in TEST_F() 425 EXPECT_THAT(tree.getText(&len), StrEq(u" H ")); in TEST_F() [all …]
|
/aosp14/system/core/fastboot/device/ |
H A D | usb.cpp | 85 int orig_len = len; in usb_ffs_write() 86 while (len > 0) { in usb_ffs_write() 94 len -= n; in usb_ffs_write() 105 int orig_len = len; in usb_ffs_read() 107 while (len > 0) { in usb_ffs_read() 108 int read_len = std::min(USB_FFS_BULK_SIZE, len); in usb_ffs_read() 115 len -= n; in usb_ffs_read() 135 int num_bufs = len / h->io_size + (len % h->io_size == 0 ? 0 : 1); in usb_ffs_do_aio() 147 len -= buf_len; in usb_ffs_do_aio() 189 return usb_ffs_do_aio(h, data, len, true); in usb_ffs_aio_read() [all …]
|
H A D | usb_iouring.cpp | 32 io_uring_prep_read(sqe, fd, data, len, offset); in prep_async_read() 47 io_uring_prep_write(sqe, fd, data, len, offset); in prep_async_write() 54 return prep_async_read(ring, fd, data, len, offset); in prep_async_io() 56 return prep_async_write(ring, fd, data, len, offset); in prep_async_io() 68 static int usb_ffs_do_aio(usb_handle* h, T* const data, const int len) { in usb_ffs_do_aio() argument 70 const int num_requests = DivRoundup<int>(len, h->io_size); in usb_ffs_do_aio() 74 for (int bytes_remain = len; bytes_remain > 0;) { in usb_ffs_do_aio() 105 << " request size: " << len << ", io_size: " << h->io_size in usb_ffs_do_aio() 119 return usb_ffs_do_aio<true>(h, data, len); in usb_ffs_io_uring_read() 122 static int usb_ffs_io_uring_write(usb_handle* h, const void* data, int len) { in usb_ffs_io_uring_write() argument [all …]
|
/aosp14/system/core/libcutils/ |
H A D | fs_config_test.cpp | 174 size_t len = data.size(); in check_unique() local 178 while (len > 0) { in check_unique() 179 uint16_t host_len = (len >= endof(pc, len)) ? pc->len : INT16_MAX; in check_unique() 180 if (host_len > len) { in check_unique() 182 << host_len << " > " << len << ")"; in check_unique() 186 << "len=" << ((len >= endof(pc, len)) in check_unique() 189 << ", mode=" << ((len >= endof(pc, mode)) in check_unique() 192 << ", uid=" << ((len >= endof(pc, uid)) in check_unique() 195 << ", gid=" << ((len >= endof(pc, gid)) in check_unique() 199 << ((len >= endof(pc, capabilities)) in check_unique() [all …]
|
H A D | fs_config.cpp | 242 if (len < strlen(suffix)) return len; in strip() 243 if (strncmp(path + len - strlen(suffix), suffix, strlen(suffix))) return len; in strip() 244 return len - strlen(suffix); in strip() 255 size_t len = strlen(target_out_path); in fs_config_open() local 256 len = strip(target_out_path, len, "/"); in fs_config_open() 257 len = strip(target_out_path, len, "/system"); in fs_config_open() 282 std::string pattern(prefix, len); in fs_config_cmp() 343 uint16_t host_len = header.len; in fs_config() 344 ssize_t len, remainder = host_len - sizeof(header); in fs_config() local 359 len = strnlen(prefix, remainder); in fs_config() [all …]
|
H A D | properties_test.cpp | 108 EXPECT_EQ(strlen(PROPERTY_TEST_VALUE_DEFAULT), len); in TEST_F() 114 size_t len = SetAndGetProperty("hello_world"); in TEST_F() local 115 EXPECT_EQ(strlen("hello_world"), len) << "hello_world key"; in TEST_F() 123 size_t len = SetAndGetProperty("", EMPTY_STRING_DEFAULT); in TEST_F() local 133 int len = SetAndGetProperty(maxLengthString.c_str()); in TEST_F() local 164 EXPECT_EQ(PROPERTY_VALUE_MAX - 1, len); in TEST_F() 177 EXPECT_EQ(PROPERTY_VALUE_MAX - 1, len); in TEST_F() 190 EXPECT_EQ(1, len); in TEST_F() 203 EXPECT_EQ(0, len); in TEST_F() 213 int len = property_get(PROPERTY_TEST_KEY, mValue, NULL); in TEST_F() local [all …]
|
/aosp14/frameworks/base/core/tests/fuzzers/FuzzService/ |
H A D | random_parcel_jni.cpp | 27 size_t len = static_cast<size_t>(env->GetArrayLength(fuzzData)); in Java_randomparcel_FuzzBinder_fuzzServiceInternal() local 28 uint8_t data[len]; in Java_randomparcel_FuzzBinder_fuzzServiceInternal() 29 env->GetByteArrayRegion(fuzzData, 0, len, reinterpret_cast<jbyte*>(data)); in Java_randomparcel_FuzzBinder_fuzzServiceInternal() 31 FuzzedDataProvider provider(data, len); in Java_randomparcel_FuzzBinder_fuzzServiceInternal() 42 size_t len = static_cast<size_t>(env->GetArrayLength(fuzzData)); in Java_randomparcel_FuzzBinder_fillParcelInternal() local 43 uint8_t data[len]; in Java_randomparcel_FuzzBinder_fillParcelInternal() 44 env->GetByteArrayRegion(fuzzData, 0, len, reinterpret_cast<jbyte*>(data)); in Java_randomparcel_FuzzBinder_fillParcelInternal() 46 FuzzedDataProvider provider(data, len); in Java_randomparcel_FuzzBinder_fillParcelInternal()
|
/aosp14/frameworks/base/libs/androidfw/ |
H A D | ZipUtils.cpp | 43 bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const override { in ReadAtOffset() argument 55 size_t read = fread(buf, 1, len, mFp); in ReadAtOffset() 56 if (read != len) { in ReadAtOffset() 75 return android::base::ReadFullyAtOffset(mFd, buf, len, offset); in ReadAtOffset() 90 if (mInputSize < len || offset > mInputSize - len) { in ReadAtOffset() 95 if (!pos.verify(len)) { in ReadAtOffset() 99 memcpy(buf, pos.unsafe_ptr(), len); in ReadAtOffset() 202 int len; in examineGzip() local 204 len = getc(fp); in examineGzip() 205 len |= getc(fp) << 8; in examineGzip() [all …]
|
/aosp14/system/core/libsparse/include/sparse/ |
H A D | sparse.h | 48 struct sparse_file *sparse_file_new(unsigned int block_size, int64_t len); 78 int sparse_file_add_data(struct sparse_file* s, void* data, uint64_t len, unsigned int block); 95 int sparse_file_add_fill(struct sparse_file* s, uint32_t fill_val, uint64_t len, 119 uint64_t len, unsigned int block); 144 int sparse_file_add_fd(struct sparse_file* s, int fd, int64_t file_offset, uint64_t len, 208 int (*write)(void *priv, const void *data, size_t len), void *priv); 225 int (*write)(void *priv, const void *data, size_t len, unsigned int block, 294 struct sparse_file* sparse_file_import_buf(char* buf, size_t len, bool verbose, bool crc);
|
/aosp14/system/core/libnetutils/ |
H A D | dhcpclient.c | 182 while (len > 2) { in decode_dhcp_msg() 185 len--; in decode_dhcp_msg() 192 len -= 2; in decode_dhcp_msg() 193 if (optlen > len) { in decode_dhcp_msg() 227 len -= optlen; in decode_dhcp_msg() 303 if (len < 4) return; in dump_dhcp_msg() 304 len -= 4; in dump_dhcp_msg() 307 while (len > 2) { in dump_dhcp_msg() 310 len--; in dump_dhcp_msg() 316 len -= 2; in dump_dhcp_msg() [all …]
|