/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 | 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 | 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 | 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 | 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()
|
D | utils.cc | 274 char buf[16]; // MAX_TASK_COMM_LEN=16 is hard-coded in the kernel. in SetThreadName() local 275 strncpy(buf, s, sizeof(buf)-1); in SetThreadName() 276 buf[sizeof(buf)-1] = '\0'; in SetThreadName() 277 errno = pthread_setname_np(pthread_self(), buf); in SetThreadName() 279 PLOG(WARNING) << "Unable to set the name of current thread to '" << buf << "'"; in SetThreadName()
|
/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/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 | 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/dmtracedump/ |
D | tracedump.cc | 1250 char buf[80]; in printInclusiveMethod() local 1269 sprintf(buf, "[%d]", relative->index); in printInclusiveMethod() 1271 int32_t len = strlen(buf); in printInclusiveMethod() 1273 sprintf(buf, "<a href=\"#m%d\">[%d]", relative->index, relative->index); in printInclusiveMethod() 1285 "", space_ptr, buf, anchor_close, pTimed->numCalls, nCalls, in printInclusiveMethod() 1289 "", per, space_ptr, buf, anchor_close, pTimed->numCalls, nCalls, in printInclusiveMethod() 1296 space_ptr, buf, anchor_close, pTimed->numCalls, nCalls, in printInclusiveMethod() 1300 per, space_ptr, buf, anchor_close, pTimed->numCalls, nCalls, in printInclusiveMethod() 1518 char buf[40]; in printInclusiveProfile() local 1545 sprintf(buf, "[%d]", ii); in printInclusiveProfile() [all …]
|
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/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 | 182 static void Append2LE(uint8_t* buf, uint16_t val) { in Append2LE() argument 183 *buf++ = static_cast<uint8_t>(val); in Append2LE() 184 *buf++ = static_cast<uint8_t>(val >> 8); in Append2LE() 188 static void Append4LE(uint8_t* buf, uint32_t val) { in Append4LE() argument 189 *buf++ = static_cast<uint8_t>(val); in Append4LE() 190 *buf++ = static_cast<uint8_t>(val >> 8); in Append4LE() 191 *buf++ = static_cast<uint8_t>(val >> 16); in Append4LE() 192 *buf++ = static_cast<uint8_t>(val >> 24); in Append4LE() 196 static void Append8LE(uint8_t* buf, uint64_t val) { in Append8LE() argument 197 *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/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 | 260 auto line_buf_fn = [&](char* buf, size_t len) { 271 error_buf.insert(error_buf.end(), buf, buf + len); 278 memcpy(&line[line_len], buf, copy); 279 buf += copy;
|