Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 119) sorted by relevance

12345

/wasmtime-44.0.1/crates/test-programs/src/bin/
H A Dp1_readlink.rs14 let buf = &mut [0u8; 10]; in test_readlink() localVariable
15 let bufused = wasip1::path_readlink(dir_fd, "symlink", buf.as_mut_ptr(), buf.len()) in test_readlink()
20 &buf[6..], in test_readlink()
26 let buf = &mut [0u8; 4]; in test_readlink() localVariable
27 let bufused = wasip1::path_readlink(dir_fd, "symlink", buf.as_mut_ptr(), buf.len()) in test_readlink()
30 assert_eq!(buf, b"targ"); in test_readlink()
43 let mut buf = Vec::new(); in test_incremental_readlink() localVariable
48 let bufused = wasip1::path_readlink(dir_fd, "symlink", buf.as_mut_ptr(), buf.capacity()) in test_incremental_readlink()
50 buf.set_len(bufused); in test_incremental_readlink()
51 if buf.capacity() > filename.len() { in test_incremental_readlink()
[all …]
H A Dp2_cli_multiple_preopens.rs15 let mut buf = [0; 100]; in main() localVariable
17 wasip1::fd_prestat_dir_name(3, buf.as_mut_ptr(), buf.len()).unwrap(); in main()
18 assert_eq!(str::from_utf8(&buf[..2]).unwrap(), "/a"); in main()
19 wasip1::fd_prestat_dir_name(4, buf.as_mut_ptr(), buf.len()).unwrap(); in main()
20 assert_eq!(str::from_utf8(&buf[..2]).unwrap(), "/b"); in main()
21 wasip1::fd_prestat_dir_name(5, buf.as_mut_ptr(), buf.len()).unwrap(); in main()
22 assert_eq!(str::from_utf8(&buf[..2]).unwrap(), "/c"); in main()
24 wasip1::fd_prestat_dir_name(6, buf.as_mut_ptr(), buf.len()), in main()
H A Dp1_fd_readdir.rs16 buf: &'a [u8], field
20 fn from_slice(buf: &'a [u8]) -> Self { in from_slice()
21 Self { buf } in from_slice()
50 self.buf = &self.buf[delta..]; in next()
228 let mut buf = Vec::new(); in test_fd_readdir_unicode_boundary() localVariable
230 let len = wasip1::fd_readdir(dir_fd, buf.as_mut_ptr(), buf.capacity(), 0).unwrap(); in test_fd_readdir_unicode_boundary()
231 buf.set_len(len); in test_fd_readdir_unicode_boundary()
238 buf = Vec::with_capacity(buf.capacity() + 1); in test_fd_readdir_unicode_boundary()
257 let mut buf = vec![0; 128]; in test_fd_readdir_past_end() localVariable
258 let len = wasip1::fd_readdir(dir_fd, buf.as_mut_ptr(), buf.capacity(), 0).unwrap(); in test_fd_readdir_past_end()
[all …]
H A Dp1_file_pread_pwrite.rs25 buf: contents.as_ptr() as *const _, in test_file_pread_pwrite()
33 buf: contents.as_mut_ptr() as *mut _, in test_file_pread_pwrite()
103 buf: contents.as_mut_ptr() as *mut _, in test_file_pread_pwrite()
112 buf: contents.as_ptr() as *const _, in test_file_pread_pwrite()
153 buf: [].as_ptr(), in test_file_pwrite_and_file_pos()
164 let buf = [0]; in test_file_pwrite_and_file_pos() localVariable
166 buf: buf.as_ptr(), in test_file_pwrite_and_file_pos()
167 buf_len: buf.len(), in test_file_pwrite_and_file_pos()
195 let buf = [0]; in test_file_pwrite_and_append() localVariable
197 buf: buf.as_ptr(), in test_file_pwrite_and_append()
[all …]
H A Dp1_file_read_write.rs25 buf: contents.as_ptr() as *const _, in test_file_read_write()
33 buf: contents.as_mut_ptr() as *mut _, in test_file_read_write()
86 buf: buffer.as_mut_ptr() as *mut _, in test_file_read_write()
90 buf: buffer[2..].as_mut_ptr() as *mut _, in test_file_read_write()
106 buf: contents.as_mut_ptr() as *mut _, in test_file_read_write()
116 buf: contents.as_ptr() as *const _, in test_file_read_write()
125 buf: contents.as_mut_ptr() as *mut _, in test_file_read_write()
159 buf: [].as_ptr(), in test_file_write_and_file_pos()
171 let buf = [0]; in test_file_write_and_file_pos() localVariable
173 buf: buf.as_ptr(), in test_file_write_and_file_pos()
[all …]
H A Dp1_big_random_buf.rs2 let mut buf = Vec::new(); in test_big_random_buf() localVariable
3 buf.resize(1024, 0); in test_big_random_buf()
5 wasip1::random_get(buf.as_mut_ptr(), 1024).expect("failed to call random_get"); in test_big_random_buf()
9 assert!(buf.iter().any(|x| *x != 0), "random_get returned all zeros"); in test_big_random_buf()
H A Dp3_sockets_udp_sample_application.rs37 let (buf, addr) = server.receive().await.unwrap(); in test_udp_sample_application()
38 assert_eq!(buf, first_message); in test_udp_sample_application()
41 let (buf, addr) = server.receive().await.unwrap(); in test_udp_sample_application()
42 assert_eq!(buf, second_message); in test_udp_sample_application()
58 let (buf, _) = server.receive().await.unwrap(); in test_udp_sample_application()
59 assert_eq!(buf, third_message); in test_udp_sample_application()
H A Dp3_cli_read_stdin.rs10 let (sresult, buf) = stream.read(Vec::with_capacity(100)).await; in run()
11 assert_eq!(buf, b"hello!".to_vec()); in run()
14 let (sresult, buf) = stream.read(Vec::with_capacity(100)).await; in run()
15 assert!(buf.is_empty()); in run()
H A Dp1_fd_flags_set.rs26 buf: data.as_ptr(), in test_fd_fdstat_set_flags()
44 buf: buffer.as_mut_ptr(), in test_fd_fdstat_set_flags()
65 buf: data.as_ptr(), in test_fd_fdstat_set_flags()
81 buf: buffer.as_mut_ptr(), in test_fd_fdstat_set_flags()
104 buf: data.as_ptr(), in test_fd_fdstat_set_flags()
120 buf: buffer.as_mut_ptr(), in test_fd_fdstat_set_flags()
H A Dp3_sockets_tcp_streams.rs23 let (status, buf) = client.receive_stream.read(Vec::with_capacity(4)).await; in test_tcp_ping_pong()
25 assert_eq!(buf, b"ping"); in test_tcp_ping_pong()
32 let (status, buf) = server.receive_stream.read(Vec::with_capacity(4)).await; in test_tcp_ping_pong()
34 assert_eq!(buf, b"pong"); in test_tcp_ping_pong()
232 let mut buf = Vec::with_capacity(1024); in test_tcp_read_cancellation() localVariable
236 assert!(buf.is_empty()); in test_tcp_read_cancellation()
238 let mut fut = pin!(server.receive_stream.read(buf)); in test_tcp_read_cancellation()
245 buf = b; in test_tcp_read_cancellation()
248 assert_eq!(buf.len(), n); in test_tcp_read_cancellation()
249 for slot in buf.iter_mut() { in test_tcp_read_cancellation()
[all …]
/wasmtime-44.0.1/cranelift/codegen/src/machinst/
H A Dbuffer.rs2442 buf, in new()
2461 self.buf in append()
2506 self.buf in finish()
2552 let buf = buf.finish(&constants, state.ctrl_plane_mut()); in test_elide_jump_to_next() localVariable
2583 let buf = buf.finish(&constants, state.ctrl_plane_mut()); in test_elide_trivial_jump_blocks() localVariable
2616 let buf = buf.finish(&constants, state.ctrl_plane_mut()); in test_flip_cond() localVariable
2667 let buf = buf.finish(&constants, state.ctrl_plane_mut()); in test_island() localVariable
2733 let buf = buf.finish(&constants, state.ctrl_plane_mut()); in test_island_backward() localVariable
2836 let buf = buf.finish(&constants, state.ctrl_plane_mut()); in test_multiple_redirect() localVariable
2894 let buf = buf.finish(&constants, state.ctrl_plane_mut()); in test_handle_branch_cycle() localVariable
[all …]
H A Dmod.rs448 let mut buf = String::new(); in disassemble() localVariable
468 writeln!(buf, "block{n}: ; offset 0x{start:x}")?; in disassemble()
473 write!(buf, " ")?; in disassemble()
477 write!(buf, "{s}")?; in disassemble()
479 write!(buf, " ")?; in disassemble()
483 write!(buf, "{op_str}")?; in disassemble()
490 buf, in disassemble()
499 write!(buf, " ; trap: {}", trap.code)?; in disassemble()
506 buf, in disassemble()
513 writeln!(buf)?; in disassemble()
[all …]
/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/concurrent/futures_and_streams/
H A Dbuffers.rs30 buf: SendSyncPtr<dyn WriteBuffer<()>>, field
53 buf: SendSyncPtr::new( in new()
78 untyped: self.buf.as_ptr(), in get_mut()
467 dst.move_from(&mut buf, 1); in test_vec_buffer_take()
468 assert_eq!(buf.remaining().len(), 2); in test_vec_buffer_take()
470 None.move_from(&mut buf, 1); in test_vec_buffer_take()
480 dst.move_from(&mut buf, 1); in test_slice_buffer_take()
491 dst.move_from(&mut buf, 1); in test_cursor_bytes_take()
497 dst.move_from(&mut buf, 1); in test_cursor_bytes_take()
508 dst.move_from(&mut buf, 1); in test_cursor_bytes_mut_take()
[all …]
/wasmtime-44.0.1/crates/wasi-common/src/
H A Drandom.rs29 fn fill_bytes(&mut self, buf: &mut [u8]) { in fill_bytes()
30 for b in buf.iter_mut() { in fill_bytes()
34 fn try_fill_bytes(&mut self, buf: &mut [u8]) -> Result<(), cap_rand::Error> { in try_fill_bytes()
35 self.fill_bytes(buf); in try_fill_bytes()
46 let mut buf = vec![0; 1024]; in deterministic() localVariable
47 det.try_fill_bytes(&mut buf).expect("get randomness"); in deterministic()
48 for (ix, b) in buf.iter().enumerate() { in deterministic()
/wasmtime-44.0.1/cranelift/codegen/src/isa/
H A Dunwind.rs218 buf: &'a mut [u8], field
223 pub fn new(buf: &'a mut [u8]) -> Self { in new()
224 Self { buf, offset: 0 } in new()
228 self.buf[self.offset] = v; in write_u8()
233 self.buf[self.offset..(self.offset + 2)].copy_from_slice(&v.to_le_bytes()); in write_u16_le()
238 self.buf[self.offset..(self.offset + 2)].copy_from_slice(&v.to_be_bytes()); in write_u16_be()
243 self.buf[self.offset..(self.offset + 4)].copy_from_slice(&v.to_le_bytes()); in write_u32_le()
248 self.buf[self.offset..(self.offset + 4)].copy_from_slice(&v.to_be_bytes()); in write_u32_be()
/wasmtime-44.0.1/cranelift/assembler-x64/src/
H A Dcustom.rs6 buf.put1(0x90); in nop_1b()
11 buf.put1(0x66); in nop_2b()
12 buf.put1(0x90); in nop_2b()
17 buf.put1(0x0F); in nop_3b()
18 buf.put1(0x1F); in nop_3b()
19 buf.put1(0x00); in nop_3b()
24 buf.put1(0x0F); in nop_4b()
25 buf.put1(0x1F); in nop_4b()
26 buf.put1(0x40); in nop_4b()
27 buf.put1(0x00); in nop_4b()
[all …]
/wasmtime-44.0.1/crates/wasi/src/cli/
H A Dfile.rs72 buf: &[u8], in poll_write()
74 match (&*self.file).write_all(buf) { in poll_write()
75 Ok(()) => Poll::Ready(Ok(buf.len())), in poll_write()
127 let mut buf = bytes::BytesMut::zeroed(size.min(crate::MAX_READ_SIZE_ALLOC)); in read() localVariable
130 .read(&mut buf) in read()
135 buf.truncate(bytes_read); in read()
136 StreamResult::Ok(buf.into()) in read()
144 buf: &mut io::ReadBuf<'_>, in poll_read()
146 match (&*self.file).read(buf.initialize_unfilled()) { in poll_read()
148 buf.advance(n); in poll_read()
/wasmtime-44.0.1/crates/wasi-tls/src/p3/util/
H A Dpipe.rs26 buf: &mut ReadBuf<'_>, in poll_read()
28 Pin::new(&mut self.0).poll_read(cx, buf) in poll_read()
36 buf: &[u8], in poll_write()
38 Pin::new(&mut self.0).poll_write(cx, buf) in poll_write()
59 let mut buf = vec![0u8; 12]; in basic_functionality() localVariable
60 r.read_exact(&mut buf).await.unwrap(); in basic_functionality()
61 assert_eq!(&buf, b"hello, world"); in basic_functionality()
H A Dshared.rs27 buf: &mut ReadBuf<'_>, in poll_read()
29 Pin::new(&mut *self.lock()).poll_read(cx, buf) in poll_read()
36 buf: &[u8], in poll_write()
38 Pin::new(&mut *self.lock()).poll_write(cx, buf) in poll_write()
/wasmtime-44.0.1/crates/wasi/src/
H A Drandom.rs115 fn fill_bytes(&mut self, buf: &mut [u8]) { in fill_bytes()
116 for b in buf.iter_mut() { in fill_bytes()
120 fn try_fill_bytes(&mut self, buf: &mut [u8]) -> Result<(), cap_rand::Error> { in try_fill_bytes()
121 self.fill_bytes(buf); in try_fill_bytes()
132 let mut buf = vec![0; 1024]; in deterministic() localVariable
133 det.try_fill_bytes(&mut buf).expect("get randomness"); in deterministic()
134 for (ix, b) in buf.iter().enumerate() { in deterministic()
/wasmtime-44.0.1/crates/wasi/src/sockets/
H A Dudp.rs183 buf: Vec<u8>, in send_p3()
230 Mode::Send(socket) => send(&socket, &buf).await, in send_p3()
252 let mut buf = vec![0; super::MAX_UDP_DATAGRAM_SIZE]; in receive_p3() localVariable
255 let n = socket.recv(&mut buf).await?; in receive_p3()
263 buf.truncate(n); in receive_p3()
264 Ok((buf, addr)) in receive_p3()
339 let n = socket.send(buf).await?; in send()
345 if n != buf.len() { in send()
355 buf: &[u8], in send_to()
358 let n = socket.send_to(buf, addr).await?; in send_to()
[all …]
/wasmtime-44.0.1/crates/wasi-http/src/
H A Dio.rs27 mut buf: ReadBufCursor<'_>, in poll_read()
30 let mut dst = ReadBuf::uninit(buf.as_mut()); in poll_read()
33 buf.advance(amt); in poll_read()
43 buf: &[u8], in poll_write()
45 Pin::new(&mut self.inner).poll_write(cx, buf) in poll_write()
/wasmtime-44.0.1/crates/wasi/src/p2/
H A Dfilesystem.rs91 match file.read_at(&mut buf, offset) { in blocking_read()
94 buf.truncate(n); in blocking_read()
95 return ReadState::DataAvailable(buf.freeze()); in blocking_read()
243 mut buf: Bytes, in blocking_write()
252 let nwritten = file.write_at(buf.as_ref(), p)?; in blocking_write()
254 let _ = buf.split_to(nwritten); in blocking_write()
257 if buf.is_empty() { in blocking_write()
266 let nwritten = file.append(buf.as_ref())?; in blocking_write()
267 let _ = buf.split_to(nwritten); in blocking_write()
269 if buf.is_empty() { in blocking_write()
[all …]
/wasmtime-44.0.1/crates/c-api/tests/
H A Dwasip2.cc27 [](void *, const unsigned char *buf, size_t len) -> ptrdiff_t { in TEST() argument
28 std::cout << std::string_view{(const char *)(buf), len}; in TEST()
34 [](void *, const unsigned char *buf, size_t len) -> ptrdiff_t { in TEST() argument
35 std::cerr << std::string_view{(const char *)(buf), len}; in TEST()
/wasmtime-44.0.1/crates/gdbstub-component/src/
H A Dtarget.rs148 buf: &mut [u8], in read_register()
153 let n = bytes.len().min(buf.len()); in read_register()
306 buf: &mut [u8], in get_libraries()
326 let n = avail.min(length).min(buf.len()); in get_libraries()
337 buf: &mut [u8], in memory_map_xml()
346 let n = avail.min(length).min(buf.len()); in memory_map_xml()
378 buf: &mut [u8], in read_wasm_local()
390 buf[..bytes.len()].copy_from_slice(&bytes); in read_wasm_local()
399 buf: &mut [u8], in read_wasm_global()
415 buf[..bytes.len()].copy_from_slice(&bytes); in read_wasm_global()
[all …]

12345