/art/libartbase/base/unix_file/ |
D | random_access_file_test.h | 56 char buf[256]; in ReadString() local 59 while ((n = f->Read(buf, sizeof(buf), offset)) > 0) { in ReadString() 60 s->append(buf, n); in ReadString() 67 char buf[256]; in TestRead() local 72 ASSERT_EQ(0, file->Read(buf, 0, 0)); in TestRead() 73 ASSERT_EQ(0, file->Read(buf, 123, 0)); in TestRead() 85 std::unique_ptr<char[]> buf(new char[buf_size]); in TestReadContent() 87 ASSERT_EQ(-EINVAL, file->Read(buf.get(), 0, -123)); in TestReadContent() 90 ASSERT_EQ(content.size(), static_cast<uint64_t>(file->Read(buf.get(), buf_size, 0))); in TestReadContent() 91 ASSERT_EQ(std::string(buf.get(), content.size()), content); in TestReadContent() [all …]
|
D | random_access_file_utils.cc | 28 std::vector<char> buf(4096); in CopyFile() local 31 while ((n = src.Read(&buf[0], buf.size(), offset)) > 0) { in CopyFile() 32 if (dst->Write(&buf[0], n, offset) != n) { in CopyFile()
|
D | random_access_file.h | 45 virtual int64_t Read(char* buf, int64_t byte_count, int64_t offset) const = 0; 60 virtual int64_t Write(const char* buf, int64_t byte_count, int64_t offset) = 0;
|
D | fd_file.cc | 103 static ssize_t pwrite(int fd, const void* buf, size_t count, off64_t offset) { in pwrite() argument 117 if (!::WriteFile(handle, buf, count, &bytes_written, &overlapped)) { in pwrite() 371 int64_t FdFile::Read(char* buf, int64_t byte_count, int64_t offset) const { in Read() argument 373 int rc = TEMP_FAILURE_RETRY(pread64(fd_, buf, byte_count, offset)); in Read() 375 int rc = TEMP_FAILURE_RETRY(pread(fd_, buf, byte_count, offset)); in Read() 397 int64_t FdFile::Write(const char* buf, int64_t byte_count, int64_t offset) { in Write() argument 400 int rc = TEMP_FAILURE_RETRY(pwrite64(fd_, buf, byte_count, offset)); in Write() 402 int rc = TEMP_FAILURE_RETRY(pwrite(fd_, buf, byte_count, offset)); in Write() 424 static ssize_t ReadIgnoreOffset(int fd, void *buf, size_t count, off_t offset) { in ReadIgnoreOffset() argument 426 return read(fd, buf, count); in ReadIgnoreOffset()
|
/art/libartbase/base/ |
D | logging.cc | 133 char* buf = nullptr; in LogLineLowStack() local 140 buf = reinterpret_cast<char*>(malloc(buf_size)); in LogLineLowStack() 142 if (buf != nullptr) { in LogLineLowStack() 143 snprintf(buf, buf_size, "%s:%u] %s", file, line, message); in LogLineLowStack() 144 android_writeLog(priority, tag, buf); in LogLineLowStack() 145 free(buf); in LogLineLowStack() 177 char buf[kBufSize + 1]; // +1 for terminator. in PrintFileToLog() local 181 int64_t n = TEMP_FAILURE_RETRY(read(file.Fd(), &buf[filled_to], kBufSize - filled_to)); in PrintFileToLog() 185 buf[filled_to] = 0; in PrintFileToLog() 186 LOG(level) << buf; in PrintFileToLog() [all …]
|
D | endian_utils.h | 66 inline void SetBytes(uint8_t* buf, T val) { in SetBytes() argument 67 memcpy(buf, &val, sizeof(T)); in SetBytes() 70 inline void Set1(uint8_t* buf, uint8_t val) { in Set1() argument 71 *buf = val; in Set1() 74 inline void Set2BE(uint8_t* buf, uint16_t val) { in Set2BE() argument 75 SetBytes<uint16_t>(buf, htobe16(val)); in Set2BE() 78 inline void Set4BE(uint8_t* buf, uint32_t val) { in Set4BE() argument 79 SetBytes<uint32_t>(buf, htobe32(val)); in Set4BE() 82 inline void Set8BE(uint8_t* buf, uint64_t val) { in Set8BE() argument 83 SetBytes<uint64_t>(buf, htobe64(val)); in Set8BE()
|
D | bit_vector_test.cc | 248 uint32_t buf; in TEST() local 250 bv.CopyTo(&buf, sizeof(buf)); in TEST() 252 EXPECT_EQ(0u, buf); in TEST() 258 uint32_t buf; in TEST() local 263 EXPECT_EQ(sizeof(buf), bv.GetSizeOf()); in TEST() 265 bv.CopyTo(&buf, sizeof(buf)); in TEST() 266 EXPECT_EQ(0x04020001u, buf); in TEST() 273 uint8_t buf[5]; in TEST() local 277 EXPECT_LT(sizeof(buf), bv.GetSizeOf()); in TEST() 279 bv.CopyTo(buf, sizeof(buf)); in TEST() [all …]
|
D | utils.cc | 306 char buf[16]; // MAX_TASK_COMM_LEN=16 is hard-coded in the kernel. in SetThreadName() local 307 strncpy(buf, s, sizeof(buf)-1); in SetThreadName() 308 buf[sizeof(buf)-1] = '\0'; in SetThreadName() 309 errno = pthread_setname_np(pthread_self(), buf); in SetThreadName() 311 PLOG(WARNING) << "Unable to set the name of current thread to '" << buf << "'"; in SetThreadName() 369 size_t GetOsThreadStat(pid_t tid, char* buf, size_t len) { in GetOsThreadStat() argument 376 ssize_t bytes_read = TEMP_FAILURE_RETRY(read(stat_fd, buf, len)); in GetOsThreadStat() 380 buf[len - 1] = '\0'; in GetOsThreadStat() 385 UNUSED(buf); in GetOsThreadStat() 393 char buf[BUF_SIZE]; in GetOsThreadStatQuick() local [all …]
|
D | zip_archive_test.cc | 56 uint8_t buf[kBufSize]; in TEST_F() local 58 ssize_t bytes_read = TEMP_FAILURE_RETRY(read(fd, buf, kBufSize)); in TEST_F() 62 computed_crc = crc32(computed_crc, buf, bytes_read); in TEST_F()
|
/art/libdexfile/dex/ |
D | utf_test.cc | 316 static void testConversions(uint16_t *buf, int char_count) { in testConversions() argument 323 byte_count_reference = CountModifiedUtf8BytesInUtf16_reference(buf, char_count); in testConversions() 324 byte_count_test = CountModifiedUtf8BytesInUtf16(buf, char_count); in testConversions() 328 ConvertUtf16ToModifiedUtf8_reference(bytes_reference, buf, char_count); in testConversions() 329 ConvertUtf16ToModifiedUtf8(bytes_test, byte_count_test, buf, char_count); in testConversions() 347 EXPECT_EQ(buf[i], out_buf_reference[i]); in testConversions() 348 EXPECT_EQ(buf[i], out_buf_test[i]); in testConversions() 354 uint16_t buf[4] = { 0 }; in TEST_F() local 362 buf[0] = 'h'; in TEST_F() 363 buf[1] = codePoint; in TEST_F() [all …]
|
/art/libartservice/service/java/com/android/server/art/ |
D | IndentingPrintWriter.java | 87 final char[] buf = new char[len]; in write() local 88 s.getChars(off, len - off, buf, 0); in write() 89 write(buf, 0, len); in write() 93 public void write(@NonNull char[] buf, int offset, int count) { in write() argument 101 char ch = buf[lineEnd++]; in write() 105 super.write(buf, lineStart, lineEnd - lineStart); in write() 114 super.write(buf, lineStart, lineEnd - lineStart); in write()
|
/art/dt_fd_forward/export/ |
D | fd_transport.h | 37 void WriteData(void* buf) { in WriteData() 38 int* ibuf = reinterpret_cast<int*>(buf); in WriteData() 44 static FdSet ReadData(void* buf) { in ReadData() 45 int* ibuf = reinterpret_cast<int*>(buf); in ReadData()
|
/art/libnativebridge/tests/ |
D | PreInitializeNativeBridge_test.cpp | 52 char buf[1024]; in TEST_F() local 53 EXPECT_NE(nullptr, fgets(buf, sizeof(buf), proc_cpuinfo)) << "Error reading."; in TEST_F() 56 EXPECT_EQ(0, strcmp(buf, kTestData)); in TEST_F()
|
/art/tools/ |
D | dt_fds_forward.py | 99 buf = local_sock.recv(1024) 100 print("Local_sock has data: " + str(buf)) 101 if buf == LISTEN_START_MESSAGE: 104 elif buf == LISTEN_END_MESSAGE: 107 elif buf == ACCEPTED_MESSAGE: 109 elif buf == HANDSHAKEN_MESSAGE: 111 elif buf == CLOSE_MESSAGE: 115 print("Unknown data received from socket " + str(buf))
|
D | stream-trace-converter.py | 64 buf = input.read(length) 65 if len(buf) != length: 67 output.write(buf)
|
/art/tools/ahat/src/main/com/android/ahat/ |
D | StaticHandler.java | 52 byte[] buf = new byte[4096]; in handle() 53 while ((read = is.read(buf)) >= 0) { in handle() 54 os.write(buf, 0, read); in handle()
|
/art/openjdkjvm/ |
D | OpenjdkJvm.cc | 104 JNIEXPORT jint JVM_Read(jint fd, char* buf, jint nbytes) { in JVM_Read() argument 105 return TEMP_FAILURE_RETRY(read(fd, buf, nbytes)); in JVM_Read() 109 JNIEXPORT jint JVM_Write(jint fd, char* buf, jint nbytes) { in JVM_Write() argument 110 return TEMP_FAILURE_RETRY(write(fd, buf, nbytes)); in JVM_Write() 162 JNIEXPORT jint JVM_GetLastErrorString(char* buf, int len) { in JVM_GetLastErrorString() argument 169 char* result = strerror_r(err, buf, len); in JVM_GetLastErrorString() 170 if (result != buf) { in JVM_GetLastErrorString() 171 strncpy(buf, result, len); in JVM_GetLastErrorString() 172 buf[len - 1] = '\0'; in JVM_GetLastErrorString() 175 return strlen(buf); in JVM_GetLastErrorString() [all …]
|
/art/runtime/ |
D | trace.cc | 451 static void Append2LE(uint8_t* buf, uint16_t val) { in Append2LE() argument 452 *buf++ = static_cast<uint8_t>(val); in Append2LE() 453 *buf++ = static_cast<uint8_t>(val >> 8); in Append2LE() 457 static void Append4LE(uint8_t* buf, uint32_t val) { in Append4LE() argument 458 *buf++ = static_cast<uint8_t>(val); in Append4LE() 459 *buf++ = static_cast<uint8_t>(val >> 8); in Append4LE() 460 *buf++ = static_cast<uint8_t>(val >> 16); in Append4LE() 461 *buf++ = static_cast<uint8_t>(val >> 24); in Append4LE() 465 static void Append8LE(uint8_t* buf, uint64_t val) { in Append8LE() argument 466 *buf++ = static_cast<uint8_t>(val); in Append8LE() [all …]
|
/art/test/580-crc32/src/ |
D | Main.java | 348 ByteBuffer buf = ByteBuffer.wrap(bytes, 0, off + len); in CRC32ByteBuffer() local 349 buf.position(off); in CRC32ByteBuffer() 351 crc32.update(buf); in CRC32ByteBuffer() 416 ByteBuffer buf = ByteBuffer.allocateDirect(total_len).put(bytes, 0, total_len); in CRC32DirectByteBuffer() local 417 buf.position(off); in CRC32DirectByteBuffer() 419 crc32.update(buf); in CRC32DirectByteBuffer() 424 ByteBuffer buf = ByteBuffer.allocateDirect(bytes.length).put(bytes); in CRC32ByteAndDirectByteBuffer() local 425 buf.position(0); in CRC32ByteAndDirectByteBuffer() 428 crc32.update(buf); in CRC32ByteAndDirectByteBuffer() 433 ByteBuffer buf = ByteBuffer.allocateDirect(bytes.length).put(bytes); in CRC32DirectByteBufferAndByte() local [all …]
|
/art/compiler/linker/ |
D | output_stream_test.cc | 45 uint8_t buf[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; in GenerateTestOutput() local 46 EXPECT_TRUE(output_stream_->WriteFully(buf, 2)); in GenerateTestOutput() 50 EXPECT_TRUE(output_stream_->WriteFully(buf, 4)); in GenerateTestOutput() 52 EXPECT_TRUE(output_stream_->WriteFully(buf, 6)); in GenerateTestOutput()
|
/art/libelffile/elf/ |
D | xz_utils.cc | 61 static SRes ReadImpl(const ISeqInStream* p, void* buf, size_t* size) { in XzCompress() 64 memcpy(buf, ctx->src_.data() + ctx->src_pos_, *size); in XzCompress() 68 static size_t WriteImpl(const ISeqOutStream* p, const void* buf, size_t size) { in XzCompress() 70 const uint8_t* buffer = reinterpret_cast<const uint8_t*>(buf); in XzCompress()
|
/art/test/004-JniTest/ |
D | jni_test.cc | 96 char buf[1024]; in Java_Main_testUTFRegion() local 97 memset(buf, 'Y', sizeof(buf)); in Java_Main_testUTFRegion() 98 buf[1023] = '\0'; in Java_Main_testUTFRegion() 100 env->GetStringUTFRegion(foo_str, 3, 1, buf); in Java_Main_testUTFRegion() 101 buf[1023] = '\0'; in Java_Main_testUTFRegion() 102 CHECK_EQ(strcmp("B", buf), 0) << buf; in Java_Main_testUTFRegion() 105 env->GetStringUTFRegion(foo_str, 3, 0, buf); in Java_Main_testUTFRegion() 106 buf[1023] = '\0'; in Java_Main_testUTFRegion() 107 CHECK_EQ(strcmp("", buf), 0) << buf; in Java_Main_testUTFRegion() 112 env->GetStringUTFRegion(null_str, 1, 1, buf); in Java_Main_testUTFRegion() [all …]
|
/art/runtime/gc/ |
D | reference_processor.cc | 177 char buf[kBufSize]; in ForwardSoftReferences() local 178 snprintf(buf, kBufSize, "Marking for %" PRIu32 " SoftReferences", non_null_refs); in ForwardSoftReferences() 179 ATraceBegin(buf); in ForwardSoftReferences() 258 char buf[kBufSize]; in ProcessReferences() local 259 snprintf(buf, kBufSize, "Marking from %" PRIu32 " / %" PRIu32 " finalizers", in ProcessReferences() 261 ATraceBegin(buf); in ProcessReferences()
|
D | reference_queue.cc | 199 ObjPtr<mirror::Reference> buf[SR_BUF_SIZE]; in ForwardSoftReferences() local 210 buf[n_entries] = DequeuePendingReference(); in ForwardSoftReferences() 215 mirror::HeapReference<mirror::Object>* referent_addr = buf[i]->GetReferentReferenceAddr(); in ForwardSoftReferences() 220 DisableReadBarrierForReference(buf[i]->AsReference(), std::memory_order_release); in ForwardSoftReferences()
|
/art/oatdump/ |
D | oatdump_test.h | 279 auto line_buf_fn = [&](char* buf, size_t len) { 290 error_buf.insert(error_buf.end(), buf, buf + len); 297 memcpy(&line[line_len], buf, copy); 298 buf += copy;
|