/system/connectivity/wifilogd/tests/ |
D | message_buffer_unittest.cpp | 37 MessageBufferTest() : buffer_{kBufferSizeBytes} {} in MessageBufferTest() 48 EXPECT_TRUE(buffer_.Append(message.data(), message.size())); in FillBufferWithMultipleMessages() 50 EXPECT_EQ(0U, buffer_.GetFreeSize()); in FillBufferWithMultipleMessages() 57 std::tie(start, len) = buffer_.ConsumeNextMessage(); in GetNextMessageAsByteVector() 61 MessageBuffer buffer_; member in android::wifilogd::__anone6264e550111::MessageBufferTest 67 EXPECT_TRUE(buffer_.Append(kSmallestMessage.data(), kSmallestMessage.size())); in TEST_F() 71 EXPECT_TRUE(buffer_.Append(kLargestMessage.data(), kLargestMessage.size())); in TEST_F() 75 ASSERT_TRUE(buffer_.Append(kLargestMessage.data(), kLargestMessage.size())); in TEST_F() 76 ASSERT_FALSE(buffer_.CanFitNow(1)); in TEST_F() 78 buffer_.Clear(); in TEST_F() [all …]
|
D | byte_buffer_unittest.cpp | 38 ByteBuffer<kBufferSizeBytes> buffer_; member in android::wifilogd::__anon71b21ee40111::ByteBufferTest 44 buffer_.AppendOrDie(kSmallestMessage.data(), kSmallestMessage.size()); in TEST_F() 48 buffer_.AppendOrDie(kLargestMessage.data(), kLargestMessage.size()); in TEST_F() 54 buffer_.AppendOrDie(message1.data(), message1.size()); in TEST_F() 55 buffer_.AppendOrDie(message2.data(), message2.size()); in TEST_F() 58 EXPECT_EQ(0, std::memcmp(buffer_.data(), expected.data(), expected.size())); in TEST_F() 63 buffer_.AppendOrDie(message1.data(), message1.size()); in TEST_F() 66 ASSERT_NE(buffer_.size(), copy.size()); in TEST_F() 68 copy = buffer_; in TEST_F() 69 ASSERT_EQ(buffer_.size(), copy.size()); in TEST_F() [all …]
|
/system/keymaster/android_keymaster/ |
D | serializable.cpp | 84 memcpy(new_buffer, buffer_.get() + read_position_, available_read()); in reserve() 85 memset_s(buffer_.get(), 0, buffer_size_); in reserve() 86 buffer_.reset(new_buffer); in reserve() 96 buffer_.reset(new (std::nothrow) uint8_t[size]); in Reinitialize() 97 if (!buffer_.get()) in Reinitialize() 109 buffer_.reset(new (std::nothrow) uint8_t[data_len]); in Reinitialize() 110 if (!buffer_.get()) in Reinitialize() 113 memcpy(buffer_.get(), data, data_len); in Reinitialize() 133 memcpy(buffer_.get() + write_position_, src, write_length); in write() 141 memcpy(dest, buffer_.get() + read_position_, read_length); in read() [all …]
|
/system/core/adb/ |
D | shell_service_protocol.cpp | 26 buffer_[0] = kIdInvalid; in ShellProtocol() 35 if (!ReadFdExactly(fd_, buffer_, kHeaderSize)) { in Read() 40 memcpy(&packet_length, &buffer_[1], sizeof(packet_length)); in Read() 57 buffer_[0] = id; in Write() 59 memcpy(&buffer_[1], &typed_length, sizeof(typed_length)); in Write() 61 return WriteFdExactly(fd_, buffer_, kHeaderSize + length); in Write()
|
D | shell_protocol.h | 68 const char* data() const { return buffer_ + kHeaderSize; } in data() 69 char* data() { return buffer_ + kHeaderSize; } in data() 84 int id() const { return buffer_[0]; } in id() 108 char buffer_[kBufferSize]; variable 113 char* buffer_end_ = buffer_ + sizeof(buffer_);
|
/system/teeui/libteeui_jni/ |
D | libteeui_jni.cpp | 75 element_type* buffer_; member in JArray 78 JArray(JNIEnv* env, array_type jarray) : env_(env), jarray_(jarray), buffer_(nullptr) { in JArray() 80 buffer_ = (env_->*JTypeTraits<T>::getArrayElements)(jarray, nullptr); in JArray() 83 JArray(JArray&& rhs) : env_(rhs.env_), jarray_(rhs.jarray_), buffer_(rhs.buffer_) { in JArray() 85 rhs.buffer_ = nullptr; in JArray() 94 buffer_ = rhs.buffer_; in operator =() 96 rhs.buffer_ = nullptr; in operator =() 101 operator bool() const { return buffer_ != nullptr; } in operator bool() 102 const jint& operator[](size_t offset) const { return buffer_[offset]; } in operator []() 103 element_type& operator[](size_t offset) { return buffer_[offset]; } in operator []() [all …]
|
/system/core/libappfuse/ |
D | FuseBridgeLoop.cc | 135 switch (buffer_.response.ReadOrAgain(proxy_fd_)) { in ReadFromProxy() 144 if (!buffer_.response.Write(device_fd_)) { in ReadFromProxy() 145 LogResponseError("Failed to write a reply from proxy to device", buffer_.response); in ReadFromProxy() 149 auto it = opcode_map_.find(buffer_.response.header.unique); in ReadFromProxy() 153 if (buffer_.response.header.error == fuse::kFuseSuccess) { in ReadFromProxy() 178 if (!buffer_.request.Read(device_fd_)) { in ReadFromDevice() 182 const uint32_t opcode = buffer_.request.header.opcode; in ReadFromDevice() 183 const uint64_t unique = buffer_.request.header.unique; in ReadFromDevice() 201 opcode_map_.emplace(buffer_.request.header.unique, opcode); in ReadFromDevice() 206 buffer_.HandleInit(); in ReadFromDevice() [all …]
|
/system/bt/gd/os/fuzz/ |
D | fuzz_inject_queue.h | 29 buffer_ = new EnqueueBuffer<T>(queue); in FuzzInjectQueue() 32 delete buffer_; in ~FuzzInjectQueue() local 36 buffer_->Enqueue(std::move(data), handler_); in Inject() 40 EnqueueBuffer<T>* buffer_;
|
/system/core/libunwindstack/tests/ |
D | MemoryOfflineBufferTest.cpp | 30 memory_.reset(new MemoryOfflineBuffer(buffer_.data(), kStart, kEnd)); in SetUp() 34 buffer_.resize(kLength); in SetUpTestSuite() 36 buffer_[i] = i % 189; in SetUpTestSuite() 45 static std::vector<uint8_t> buffer_; member in unwindstack::MemoryOfflineBufferTest 48 std::vector<uint8_t> MemoryOfflineBufferTest::buffer_; member in unwindstack::MemoryOfflineBufferTest 88 memory_->Reset(&buffer_[10], 0x12000, 0x13000); in TEST_F()
|
/system/bt/gd/os/ |
D | queue.h | 118 buffer_.push(std::move(t)); in Enqueue() 129 std::swap(buffer_, empty); in Clear() 134 return buffer_.size(); in Size() 146 std::unique_ptr<T> enqueued_t = std::move(buffer_.front()); in enqueue_callback() 147 buffer_.pop(); in enqueue_callback() 148 if (buffer_.empty() && enqueue_registered_.exchange(false)) { in enqueue_callback() 160 std::queue<std::unique_ptr<T>> buffer_; variable
|
D | queue_benchmark.cc | 69 buffer_.push(std::move(data)); in push() 71 if (buffer_.size() == 1) { in push() 78 std::unique_ptr<std::string> data = std::make_unique<std::string>(std::move(buffer_.front())); in EnqueueCallbackForTest() 79 buffer_.pop(); in EnqueueCallbackForTest() 81 if (buffer_.empty()) { in EnqueueCallbackForTest() 93 std::queue<std::string> buffer_; member in bluetooth::os::TestEnqueueEnd 118 buffer_.push(data); in DequeueCallbackForTest() 127 std::queue<std::string> buffer_; member in bluetooth::os::TestDequeueEnd
|
/system/libziparchive/ |
D | zip_writer.cc | 93 buffer_(kBufSize) { in ZipWriter() 109 buffer_(std::move(writer.buffer_)) { in ZipWriter() 121 buffer_ = std::move(writer.buffer_); in operator =() 340 z_stream_->next_out = buffer_.data(); in PrepareDeflate() 341 DCHECK_EQ(buffer_.size(), kBufSize); in PrepareDeflate() 342 z_stream_->avail_out = static_cast<uint32_t>(buffer_.size()); in PrepareDeflate() 404 size_t write_bytes = z_stream_->next_out - buffer_.data(); in CompressBytes() 405 if (fwrite(buffer_.data(), 1, write_bytes, file_) != write_bytes) { in CompressBytes() 412 z_stream_->next_out = buffer_.data(); in CompressBytes() 413 DCHECK_EQ(buffer_.size(), kBufSize); in CompressBytes() [all …]
|
/system/update_engine/common/ |
D | file_fetcher.cc | 115 buffer_.resize(kReadBufferSize); in ScheduleRead() 116 size_t bytes_to_read = buffer_.size(); in ScheduleRead() 128 buffer_.data(), in ScheduleRead() 151 !delegate_->ReceivedBytes(this, buffer_.data(), bytes_read)) in OnReadDoneCallback() 190 buffer_ = brillo::Blob(); in CleanUp()
|
/system/connectivity/wifilogd/ |
D | message_buffer.h | 40 explicit ScopedRewinder(NONNULL MessageBuffer* buffer) : buffer_(buffer) {} in ScopedRewinder() 41 ~ScopedRewinder() { buffer_->Rewind(); } in ~ScopedRewinder() 44 MessageBuffer* const buffer_;
|
/system/bt/gd/os/linux_generic/ |
D | queue_unittest.cc | 92 std::unique_ptr<std::string> data = std::move(buffer_.front()); in EnqueueCallbackForTest() 93 buffer_.pop(); in EnqueueCallbackForTest() 95 if (buffer_.empty()) { in EnqueueCallbackForTest() 99 auto pair = promise_map_->find(buffer_.size()); in EnqueueCallbackForTest() 111 std::queue<std::unique_ptr<std::string>> buffer_; member in bluetooth::os::__anon494e39b60111::TestEnqueueEnd 158 buffer_.push(std::move(data)); in DequeueCallbackForTest() 160 if (buffer_.size() == capacity_) { in DequeueCallbackForTest() 164 auto pair = promise_map_->find(buffer_.size()); in DequeueCallbackForTest() 175 std::queue<std::unique_ptr<std::string>> buffer_; member in bluetooth::os::__anon494e39b60111::TestDequeueEnd 210 test_enqueue_end.buffer_.push(std::move(data)); in TEST_F() [all …]
|
/system/update_engine/payload_consumer/ |
D | filesystem_verifier_action.cc | 75 buffer_.clear(); in Cleanup() 156 buffer_.resize(kReadFileBufferSize); in StartPartitionHashing() 187 std::min(static_cast<uint64_t>(buffer_.size()), read_end - offset_); in ScheduleRead() 194 buffer_.data(), in ScheduleRead() 221 if (!hasher_->Update(buffer_.data(), bytes_read)) { in OnReadDoneCallback() 236 if (!verity_writer_->Update(offset_, buffer_.data(), bytes_read)) { in OnReadDoneCallback() 327 buffer_.clear(); in FinishPartitionHashing()
|
D | delta_performer.cc | 240 size_t read_len = min(count, max - buffer_.size()); in CopyDataToBuffer() 243 buffer_.reserve(max); in CopyDataToBuffer() 244 buffer_.insert(buffer_.end(), bytes_start, bytes_end); in CopyDataToBuffer() 274 if (!buffer_.empty()) { in Close() 275 LOG(INFO) << "Discarding " << buffer_.size() << " unused downloaded bytes"; in Close() 573 MetadataParseResult result = ParsePayloadMetadata(buffer_, error); in Write() 589 prefs_->SetString(kPrefsManifestBytes, {buffer_.begin(), buffer_.end()}); in Write() 756 if (buffer_.size() < manifest_.signatures_size()) in Write() 993 buffer_offset_ + buffer_.size()); in CanPerformInstallOperation() 1005 TEST_AND_RETURN_FALSE(buffer_.size() >= operation.data_length()); in PerformReplaceOperation() [all …]
|
/system/core/adb/client/ |
D | incremental_server.cpp | 202 buffer_.reserve(kReadBufferSize); in IncrementalServer() 236 void erase_buffer_head(int count) { buffer_.erase(buffer_.begin(), buffer_.begin() + count); } in erase_buffer_head() 257 std::vector<char> buffer_; member in incremental::IncrementalServer 277 int bsize = buffer_.size(); in SkipToRequest() 279 uint32_t magic = be32toh(*(uint32_t*)(buffer_.data() + bcur)); in SkipToRequest() 288 (void)WriteFdExactly(output_fd_, buffer_.data(), bcur); in SkipToRequest() 292 if (magic_found && buffer_.size() >= *size + sizeof(INCR)) { in SkipToRequest() 294 memcpy(buffer, buffer_.data() + sizeof(INCR), *size); in SkipToRequest() 304 (void)WriteFdExactly(output_fd_, buffer_.data(), buffer_.size()); in SkipToRequest() 320 bsize = buffer_.size(); in SkipToRequest() [all …]
|
/system/keymaster/include/keymaster/ |
D | serializable.h | 207 Buffer() : buffer_(nullptr), buffer_size_(0), read_position_(0), write_position_(0) {} in Buffer() 208 explicit Buffer(size_t size) : buffer_(nullptr) { Reinitialize(size); } in Buffer() 209 Buffer(const void* buf, size_t size) : buffer_(nullptr) { Reinitialize(buf, size); } in Buffer() 233 const uint8_t* peek_read() const { return buffer_.get() + read_position_; } in peek_read() 241 uint8_t* peek_write() { return buffer_.get() + write_position_; } in peek_write() 259 UniquePtr<uint8_t[]> buffer_; variable
|
/system/teeui/libteeui/example/ |
D | example_utils.cpp | 46 auto acc = buffer_[pos]; in drawPixel() 47 buffer_[pos] = alfaCombineChannel(0, alfa, color, acc) | in drawPixel()
|
/system/tools/aidl/ |
D | parser.cpp | 67 buffer_ = yy_scan_buffer(&raw_buffer[0], raw_buffer.length(), scanner_); in Parser() 71 yy_delete_buffer(buffer_, scanner_); in ~Parser()
|
/system/core/adb/fastdeploy/deploypatchgenerator/ |
D | apk_archive.cpp | 46 buffer_.resize(length); in FileRegion() 47 if (auto err = adb_pread(fd.get(), buffer_.data(), length, offset); size_t(err) != length) { in FileRegion() 50 buffer_.clear(); in FileRegion() 55 const char* data() const { return mapped_ ? mapped_->data() : buffer_.data(); } in data() 56 size_t size() const { return mapped_ ? mapped_->size() : buffer_.size(); } in size() 63 std::string buffer_; member
|
/system/extras/simpleperf/ |
D | RecordReadThread.cpp | 36 : read_head_(0), write_head_(0), buffer_size_(buffer_size), buffer_(new char[buffer_size]) { in RecordBuffer() 66 memset(buffer_.get() + write_head, 0, sizeof(perf_event_header)); in AllocWriteSpace() 71 return buffer_.get() + write_head; in AllocWriteSpace() 89 (memcpy(&header, buffer_.get() + read_head, sizeof(header)) && header.size == 0)) { in GetCurrentRecord() 93 memcpy(&header, buffer_.get(), sizeof(header)); in GetCurrentRecord() 96 memcpy(&header, buffer_.get() + read_head, sizeof(header)); in GetCurrentRecord() 99 return buffer_.get() + read_head; in GetCurrentRecord() 173 buffer_ = event_fd_->GetMappedBuffer(buffer_size); in KernelRecordReader() 190 memcpy(dest, buffer_ + pos, copy_size); in ReadRecord() 192 memcpy(static_cast<char*>(dest) + copy_size, buffer_, size - copy_size); in ReadRecord()
|
/system/core/debuggerd/libdebuggerd/test/ |
D | dump_memory_test.cpp | 116 if (offset < buffer_.size()) { in Read() 117 bytes_available = buffer_.size() - offset; in Read() 129 memcpy(buffer, buffer_.data() + offset, bytes); in Read() 137 buffer_.resize(bytes); in SetReadData() 138 memcpy(buffer_.data(), buffer, bytes); in SetReadData() 144 if (bytes > buffer_.size()) { in SetPartialReadAmount() 152 std::vector<uint8_t> buffer_; member in MemoryMock
|
/system/core/libunwindstack/include/unwindstack/ |
D | Maps.h | 114 BufferMaps(const char* buffer) : buffer_(buffer) {} in BufferMaps() 120 const char* buffer_;
|