Home
last modified time | relevance | path

Searched refs:capacity (Results 1 - 19 of 19) sorted by relevance

/commonlibrary/rust/ylong_runtime/ylong_runtime/src/io/buffered/
H A Dasync_buf_writer.rs39 /// Creates a new `AsyncBufWriter<W>` with a default buffer capacity.
40 /// The default buffer capacity is 8 KB, which is the same as
59 /// Creates a new `AsyncBufWriter<W>` with a specific buffer capacity.
162 /// // Checks the capacity of the inner buffer
163 /// let capacity = buf_writer.capacity();
165 /// let without_flush = capacity - buf_writer.buffer().len();
169 pub fn capacity(&self) -> usize { in capacity() functions
170 self.buf.capacity() in capacity()
211 if self.buf.len() + buf.len() > self.buf.capacity() { in poll_write()
[all...]
H A Dasync_buf_reader.rs41 /// Creates a new `AsyncBufReader<R>` with a default buffer capacity.
42 /// The default buffer capacity is 8 KB, which is the same as
61 /// Creates a new `AsyncBufReader<R>` with a specific buffer capacity.
74 pub fn with_capacity(capacity: usize, inner: R) -> AsyncBufReader<R> { in with_capacity()
77 buf: vec![0; capacity].into_boxed_slice(), in with_capacity()
145 /// Returns the capacity of the internal buffer.
156 /// let capacity = reader.capacity();
157 /// assert_eq!(capacity, 10);
161 pub fn capacity( functions
[all...]
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/sync/mpsc/bounded/
H A Darray.rs42 capacity: usize,
58 pub(crate) fn new(capacity: usize) -> Array<T> {
59 assert!(capacity > 0, "Capacity cannot be zero.");
60 let data = (0..capacity)
69 capacity,
82 let index = (tail >> INDEX_SHIFT) % self.capacity; in prepare_send()
83 // index is bounded by capacity, unwrap is safe in prepare_send()
106 // index is bounded by capacity, unwrap is safe
144 let index = head % self.capacity;
145 // index is bounded by capacity, unwra
[all...]
H A Dmod.rs95 /// The channel is bounded with the passed in capacity.
99 /// Panics if the new capacity is initialized to zero.
264 /// Gets the capacity of the channel.
271 /// assert_eq!(tx.capacity(), 5);
273 pub fn capacity(&self) -> usize { in capacity() functions
274 self.channel.capacity() in capacity()
/commonlibrary/c_utils/base/include/
H A Dsafe_block_queue.h44 explicit SafeBlockQueue(int capacity) : maxSize_(capacity) in SafeBlockQueue() argument
177 explicit SafeBlockQueueTracking(int capacity) : SafeBlockQueue<T>(capacity) in SafeBlockQueueTracking() argument
H A Dsorted_vector.h82 * @brief Obtains the capacity of this vector, that is, the number of items
85 inline size_t Capacity() const { return vec_.capacity(); } in Capacity()
88 * @brief Sets the capacity of this vector.
90 * @param size Indicates the capacity to set.
92 * @return Returns the capacity if the operation is successful;
97 if (size < vec_.capacity()) { in SetCapcity()
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/process/pty_process/
H A Dsys.rs75 name_buf.resize(name_buf.capacity(), 0);
78 // If the vec's capacity is too small, double it.
81 name_buf.resize(name_buf.capacity(), 0)
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/
H A Dkqueue.rs66 events.capacity() as c_int, in select()
223 /// Initializes a vector of events with an initial capacity
224 pub fn with_capacity(capacity: usize) -> Self { in with_capacity()
225 Events(Vec::with_capacity(capacity)) in with_capacity()
H A Depoll.rs64 events.capacity() as i32, in select()
/commonlibrary/rust/ylong_http/ylong_http/src/h3/qpack/
H A Ddecoder.rs114 (offset, EncoderInstruction::SetCap { capacity }) => {
116 if capacity > self.max_table_capacity {
119 updater.update_capacity(capacity)?;
353 if self.table.capacity() > 0 { in stream_cancel()
380 fn update_capacity(&mut self, capacity: usize) -> Result<(), QpackError> { in update_capacity()
381 self.table.update_size(capacity); in update_capacity()
H A Dmod.rs207 capacity: usize,
H A Dtable.rs119 capacity: usize,
130 capacity: 0, in with_empty()
139 if new_cap < self.capacity {
140 let required = self.capacity - new_cap;
143 self.capacity = new_cap;
147 self.capacity = new_cap;
184 pub(crate) fn capacity(&self) -> usize {
185 self.capacity
189 if required > self.capacity {
192 let bound = self.capacity
[all...]
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/util/
H A Dslab.rs271 if slots.used > 0 || slots.slots.capacity() == 0 { in compact()
746 let capacity = 3001; in ut_slab_multi_allocate()
747 let free_queue = Arc::new(Mutex::new(Vec::with_capacity(capacity))); in ut_slab_multi_allocate()
811 let capacity = 2001; in ut_slab_multi_allocate_drop()
812 let free_queue_one = Arc::new(Mutex::new(Vec::with_capacity(capacity))); in ut_slab_multi_allocate_drop()
815 let free_queue_two = Arc::new(Mutex::new(Vec::with_capacity(capacity))); in ut_slab_multi_allocate_drop()
H A Dslots.rs20 // Index tag of empty slot, vector will panic if the new capacity exceeds
217 /// Construct a new 'Slots' container with a capacity.
226 pub fn with_capacity(capacity: usize) -> Slots<T> { in with_capacity()
228 entries: Vec::with_capacity(capacity), in with_capacity()
281 self.entries.capacity(), in fmt()
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/io/
H A Dread_buf.rs26 /// [ capacity ]
71 /// Returns the total buffer capacity.
73 pub fn capacity(&self) -> usize { in capacity() functions
147 /// Panics if n is bigger than the remaining capacity of the buf.
151 assert!(n <= remaining, "overflowed: try to initialize more bytes than the buffer's capacity, n: {}, remaining: {}", n, remaining); in initialize_unfilled_to()
213 /// initialized. If adding n bytes exceeds the capacity, the initialized
214 /// size will be set to the capacity.
217 let end = std::cmp::min(self.filled + n, self.capacity()); in assume_init()
277 assert_eq!(read_buf.capacity(), 16); in ut_test_readbuf_new()
329 assert_eq!(uninit_read_buf.capacity(), 1 in ut_test_readbuf_new()
[all...]
H A Dread_task.rs104 // Allocate spaces to read, if the remaining capacity is larger than 32 in poll_read_to_end()
110 from_raw_parts_mut(buf.as_mut_ptr().cast::<MaybeUninit<u8>>(), buf.capacity()) in poll_read_to_end()
/commonlibrary/c_utils/base/test/fuzztest/parcel_fuzzer/
H A Dparcel_fuzzer.cpp490 size_t capacity = dataProvider->ConsumeIntegralInRange<size_t>(1, MAX_BUFFER_SIZE);
491 parcel.SetDataCapacity(capacity);
/commonlibrary/rust/ylong_json/src/reader/
H A Dio_reader.rs309 assert_eq!(io_reader.buf.capacity(), 1024); in ut_io_reader_new()
/commonlibrary/rust/ylong_http/ylong_http/src/h3/qpack/format/
H A Ddecoder.rs232 DecResult::Decoded((buf_index, EncoderInstruction::SetCap { capacity: index })) in decode()

Completed in 12 milliseconds