/art/libartbase/base/ |
D | safe_copy_test.cc | 53 char buf[kPageSize]; in TEST() local 56 memset(buf, 0xCC, sizeof(buf)); in TEST() 57 EXPECT_EQ(static_cast<ssize_t>(kPageSize), SafeCopy(buf, page1, kPageSize)) << strerror(errno); in TEST() 58 EXPECT_EQ(0, memcmp(buf, page1, kPageSize)); in TEST() 61 memset(buf, 0xCC, sizeof(buf)); in TEST() 62 EXPECT_EQ(static_cast<ssize_t>(kPageSize - 1), SafeCopy(buf, page1 + 1, kPageSize)); in TEST() 63 EXPECT_EQ(0, memcmp(buf, page1 + 1, kPageSize - 1)); in TEST() 66 memset(buf, 0xCC, sizeof(buf)); in TEST() 67 EXPECT_EQ(0, SafeCopy(buf, page2 + kPageSize - 1, kPageSize)); in TEST() 70 memset(buf, 0xCC, sizeof(buf)); in TEST() [all …]
|
D | logging.cc | 108 char* buf = nullptr; in LogLineLowStack() local 115 buf = reinterpret_cast<char*>(malloc(buf_size)); in LogLineLowStack() 117 if (buf != nullptr) { in LogLineLowStack() 118 snprintf(buf, buf_size, "%s:%u] %s", file, line, message); in LogLineLowStack() 119 android_writeLog(priority, tag, buf); in LogLineLowStack() 120 free(buf); in LogLineLowStack() 152 char buf[kBufSize + 1]; // +1 for terminator. in PrintFileToLog() local 156 int64_t n = TEMP_FAILURE_RETRY(read(file.Fd(), &buf[filled_to], kBufSize - filled_to)); in PrintFileToLog() 160 buf[filled_to] = 0; in PrintFileToLog() 161 LOG(level) << buf; in PrintFileToLog() [all …]
|
D | bit_vector_test.cc | 218 uint32_t buf; in TEST() local 220 bv.CopyTo(&buf, sizeof(buf)); in TEST() 222 EXPECT_EQ(0u, buf); in TEST() 228 uint32_t buf; in TEST() local 233 EXPECT_EQ(sizeof(buf), bv.GetSizeOf()); in TEST() 235 bv.CopyTo(&buf, sizeof(buf)); in TEST() 236 EXPECT_EQ(0x04020001u, buf); in TEST() 243 uint8_t buf[5]; in TEST() local 247 EXPECT_LT(sizeof(buf), bv.GetSizeOf()); in TEST() 249 bv.CopyTo(buf, sizeof(buf)); in TEST() [all …]
|
D | utils.cc | 250 char buf[16]; // MAX_TASK_COMM_LEN=16 is hard-coded in the kernel. in SetThreadName() local 251 strncpy(buf, s, sizeof(buf)-1); in SetThreadName() 252 buf[sizeof(buf)-1] = '\0'; in SetThreadName() 253 errno = pthread_setname_np(pthread_self(), buf); in SetThreadName() 255 PLOG(WARNING) << "Unable to set the name of current thread to '" << buf << "'"; in SetThreadName()
|
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/runtime/jdwp/ |
D | jdwp_bits.h | 79 static inline void Set1(uint8_t* buf, uint8_t val) { in Set1() argument 80 *buf = val; in Set1() 84 static inline void Set2BE(uint8_t* buf, uint16_t val) { in Set2BE() argument 85 *buf++ = (uint8_t)(val >> 8); in Set2BE() 86 *buf = (uint8_t)(val); in Set2BE() 90 static inline void Set4BE(uint8_t* buf, uint32_t val) { in Set4BE() argument 91 *buf++ = (uint8_t)(val >> 24); in Set4BE() 92 *buf++ = (uint8_t)(val >> 16); in Set4BE() 93 *buf++ = (uint8_t)(val >> 8); in Set4BE() 94 *buf = (uint8_t)(val); in Set4BE() [all …]
|
D | jdwp_expand_buf.cc | 154 static void SetUtf8String(uint8_t* buf, const char* str, size_t strLen) { in SetUtf8String() argument 155 Set4BE(buf, strLen); in SetUtf8String() 157 memcpy(buf + sizeof(uint32_t), str, strLen); in SetUtf8String() 182 void expandBufAddLocation(ExpandBuf* buf, const JdwpLocation& location) { in expandBufAddLocation() argument 183 expandBufAdd1(buf, location.type_tag); in expandBufAddLocation() 184 expandBufAddObjectId(buf, location.class_id); in expandBufAddLocation() 185 expandBufAddMethodId(buf, location.method_id); in expandBufAddLocation() 186 expandBufAdd8BE(buf, location.dex_pc); in expandBufAddLocation()
|
D | jdwp.h | 67 static inline void SetFieldId(uint8_t* buf, FieldId val) { return Set8BE(buf, val); } in SetFieldId() argument 68 static inline void SetMethodId(uint8_t* buf, MethodId val) { return Set8BE(buf, val); } in SetMethodId() argument 69 static inline void SetObjectId(uint8_t* buf, ObjectId val) { return Set8BE(buf, val); } in SetObjectId() argument 70 static inline void SetRefTypeId(uint8_t* buf, RefTypeId val) { return Set8BE(buf, val); } in SetRefTypeId() argument 71 static inline void SetFrameId(uint8_t* buf, FrameId val) { return Set8BE(buf, val); } in SetFrameId() argument
|
/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 | 99 static ssize_t pwrite(int fd, const void* buf, size_t count, off64_t offset) { in pwrite() argument 113 if (!::WriteFile(handle, buf, count, &bytes_written, &overlapped)) { in pwrite() 362 int64_t FdFile::Read(char* buf, int64_t byte_count, int64_t offset) const { in Read() argument 364 int rc = TEMP_FAILURE_RETRY(pread64(fd_, buf, byte_count, offset)); in Read() 366 int rc = TEMP_FAILURE_RETRY(pread(fd_, buf, byte_count, offset)); in Read() 388 int64_t FdFile::Write(const char* buf, int64_t byte_count, int64_t offset) { in Write() argument 391 int rc = TEMP_FAILURE_RETRY(pwrite64(fd_, buf, byte_count, offset)); in Write() 393 int rc = TEMP_FAILURE_RETRY(pwrite(fd_, buf, byte_count, offset)); in Write() 415 static ssize_t ReadIgnoreOffset(int fd, void *buf, size_t count, off_t offset) { in ReadIgnoreOffset() argument 417 return read(fd, buf, count); in ReadIgnoreOffset()
|
/art/libdexfile/dex/ |
D | utf_test.cc | 316 static void testConversions(uint16_t *buf, int char_count) { in testConversions() argument 323 byte_count_reference = CountUtf8Bytes_reference(buf, char_count); in testConversions() 324 byte_count_test = CountUtf8Bytes(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/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/tools/ |
D | dt_fds_forward.py | 98 buf = local_sock.recv(1024) 99 print("Local_sock has data: " + str(buf)) 100 if buf == LISTEN_START_MESSAGE: 103 elif buf == LISTEN_END_MESSAGE: 106 elif buf == ACCEPTED_MESSAGE: 108 elif buf == CLOSE_MESSAGE: 112 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/test/909-attach-agent/src-art/ |
D | Main.java | 96 byte[] buf = new byte[16 * 1024]; in prepare() 98 int r = bis.read(buf, 0, buf.length); in prepare() 102 bos.write(buf, 0, r); in prepare()
|
/art/runtime/ |
D | trace.cc | 181 static void Append2LE(uint8_t* buf, uint16_t val) { in Append2LE() argument 182 *buf++ = static_cast<uint8_t>(val); in Append2LE() 183 *buf++ = static_cast<uint8_t>(val >> 8); in Append2LE() 187 static void Append4LE(uint8_t* buf, uint32_t val) { in Append4LE() argument 188 *buf++ = static_cast<uint8_t>(val); in Append4LE() 189 *buf++ = static_cast<uint8_t>(val >> 8); in Append4LE() 190 *buf++ = static_cast<uint8_t>(val >> 16); in Append4LE() 191 *buf++ = static_cast<uint8_t>(val >> 24); in Append4LE() 195 static void Append8LE(uint8_t* buf, uint64_t val) { in Append8LE() argument 196 *buf++ = static_cast<uint8_t>(val); in Append8LE() [all …]
|
/art/openjdkjvm/ |
D | OpenjdkJvm.cc | 101 JNIEXPORT jint JVM_Read(jint fd, char* buf, jint nbytes) { in JVM_Read() argument 102 return TEMP_FAILURE_RETRY(read(fd, buf, nbytes)); in JVM_Read() 106 JNIEXPORT jint JVM_Write(jint fd, char* buf, jint nbytes) { in JVM_Write() argument 107 return TEMP_FAILURE_RETRY(write(fd, buf, nbytes)); in JVM_Write() 159 JNIEXPORT jint JVM_GetLastErrorString(char* buf, int len) { in JVM_GetLastErrorString() argument 166 char* result = strerror_r(err, buf, len); in JVM_GetLastErrorString() 167 if (result != buf) { in JVM_GetLastErrorString() 168 strncpy(buf, result, len); in JVM_GetLastErrorString() 169 buf[len - 1] = '\0'; in JVM_GetLastErrorString() 172 return strlen(buf); in JVM_GetLastErrorString() [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/tools/dmtracedump/ |
D | createtesttrace.cc | 75 char buf[BUF_SIZE]; variable 128 while (fgets(buf, BUF_SIZE, inputFp)) { in parseInputFile() 129 char* cp = buf; in parseInputFile() 158 while (fgets(buf, BUF_SIZE, inputFp)) { in parseInputFile() 166 char* cp = buf; in parseInputFile() 235 printf("Indent: %d; IndentLevel: %d; Line: %s", indent, indentLevel, buf); in parseInputFile() 253 fprintf(stderr, "Error: line %d: %s", linenum, buf); in parseInputFile() 263 fprintf(stderr, "Error: line %d: %s", linenum, buf); in parseInputFile() 271 fprintf(stderr, "Error: line %d: %s", linenum, buf); in parseInputFile()
|
/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/libelffile/elf/ |
D | xz_utils.cc | 59 static SRes ReadImpl(const ISeqInStream* p, void* buf, size_t* size) { in XzCompress() 62 memcpy(buf, ctx->src_.data() + ctx->src_pos_, *size); in XzCompress() 66 static size_t WriteImpl(const ISeqOutStream* p, const void* buf, size_t size) { in XzCompress() 68 const uint8_t* buffer = reinterpret_cast<const uint8_t*>(buf); in XzCompress()
|
/art/oatdump/ |
D | oatdump_test.h | 250 auto line_buf_fn = [&](char* buf, size_t len) { in Exec() 261 error_buf.insert(error_buf.end(), buf, buf + len); in Exec() 268 memcpy(&line[line_len], buf, copy); in Exec() 269 buf += copy; in Exec()
|