oxc/crates/oxc_allocator/src
overlookmotel 39afb48025 feat(allocator): introduce Vec::from_array_in (#7331)
Because we lack specialization in stable Rust, `Vec::from_iter_in` is unable to take advantage of the fact that `[T; N]` has a statically knowable size.

Introduce `Vec::from_array_in` for this case, which should be able to create the `Vec` with a single static-sized memcpy, or may allow the compiler to see that it can construct the array directly in the arena, rather than construct on stack and then copy to the arena.

Also add a corresponding `AstBuilder::vec_from_array` method, and use it in various places in codebase.
2024-11-18 02:35:46 +00:00
..
address.rs refactor(allocator): add impl GetAddress for Address (#6891) 2024-10-25 15:20:21 +00:00
boxed.rs feat(allocator): introduce Vec::from_array_in (#7331) 2024-11-18 02:35:46 +00:00
clone_in.rs docs(allocator): enable lint warnings on missing docs, and add missing doc comments (#6613) 2024-10-15 22:50:48 +00:00
convert.rs docs(allocator): enable lint warnings on missing docs, and add missing doc comments (#6613) 2024-10-15 22:50:48 +00:00
lib.rs refactor(allocator): move GetAddress trait into oxc_allocator (#6738) 2024-10-21 11:46:29 +00:00
serialize.rs refactor(oxc_ast): clean up doc 2023-04-16 00:39:07 +08:00
vec.rs feat(allocator): introduce Vec::from_array_in (#7331) 2024-11-18 02:35:46 +00:00