It's implemented by laying out the elements in memory contiguously like alloc::vec::Vec

Related tags

Testing vechonk
Overview

A Vec

It's implemented by laying out the elements in memory contiguously like alloc::vec::Vec

Layout

A Vechonk is 4 usize long. It owns a single allocation, containing the elements and the metadata. The elements are laid out contiguously from the front, while the metadata is laid out contiguously from the back. Both grow towards the center until they meet and get realloced to separate them again.

│ 0 - 5 │ 5 - 3 │ ├────────────┼─────────┼─────────────────┼──────────────┼──────────────┤ size │ dynamic │ dynamic │ rest of alloc │ usize + meta │ usize + meta │ ╰────────────┴─────────┴─────────────────┴──────────────┴──────────────╯ ▲ ▲ │ │ ╰────────────│──────────────────────────╯ │ ╰─────────────────────────────────────────╯">

            Vechonk
   
    
            ╭──────────────────────────────────╮
            │ ptr   | len   | cap  | elem_size │
            ╰──────────────────────────────────╯
               │               │        │
               │               ╰────────│──────────────────────────────────────╮
               │                        │                                      │
               │               ╭────────╯                                      │
        Heap   ▼               ▼                                               ▼
        ╭────────────┬─────────┬─────────────────┬──────────────┬──────────────╮
value   │ "hello"    │ "uwu"   │  
    
            │ 0 - 5        │ 5 - 3        │
        ├────────────┼─────────┼─────────────────┼──────────────┼──────────────┤
 size   │ dynamic    │ dynamic │  rest of alloc  │ usize + meta │ usize + meta │
        ╰────────────┴─────────┴─────────────────┴──────────────┴──────────────╯
            ▲            ▲                          │              │
            ╰────────────│──────────────────────────╯              │
                         ╰─────────────────────────────────────────╯

    
   
You might also like...
Automatically cross-compiles the sysroot crates core, compiler_builtins, and alloc.

cargo-xbuild Cargo-xbuild is a wrapper for cargo build, which cross compiles the sysroot crates core, compiler_builtins, and alloc for custom targets.

Ector is an open source async, no-alloc actor framework for embedded devices

Ector is an open source async, no-alloc actor framework for embedded devices. Ector is an open source async, no-alloc actor framework for embedded dev

A no-std / no-alloc TLS 1.3 client

puny-tls - no-std/no-alloc TLS 1.3 client This is an improvement over tiny-tls-rs to make it more useable. However the only reason this exists is to r

no-std no-alloc Rust protobufs.

noproto No-std, no-alloc protocol buffers (protobuf) implementation in Rust, for embedded systems. Optimized for binary size and memory usage, not for

Process killer daemon for out-of-memory scenarios

bustd: Available memory or bust! bustd is a lightweight process killer daemon for out-of-memory scenarios for Linux! Features Small memory usage! bust

This crate allows writing a struct in Rust and have it derive a struct of arrays layed out in memory according to the arrow format.

Arrow2-derive - derive for Arrow2 This crate allows writing a struct in Rust and have it derive a struct of arrays layed out in memory according to th

bustd is a lightweight process killer daemon for out-of-memory scenarios for Linux!

bustd: Available memory or bust! bustd is a lightweight process killer daemon for out-of-memory scenarios for Linux! Features Small memory usage! bust

Provides a mechanism to lay out data into GPU buffers according to WGSL's memory layout rules

Provides a mechanism to lay out data into GPU buffers ensuring WGSL's memory layout requirements are met. Features supports all WGSL host-shareable ty

Source code for our paper
Source code for our paper "Higher-order finite elements for embedded simulation"

Higher-order Finite Elements for Embedded Simulation This repository contains the source code used to produce the results for our paper: Longva, A., L

A wallet library for Elements / Liquid written in Rust!

EDK Elements Dev Kit A modern, lightweight, descriptor-based wallet library for Elements / Liquid written in Rust! Inspired by BDK for Elements & Liqu

Some collections to store a fixed number of elements of a specific type.

This repo provide some useful data-structures, such as: Array, HashMap, HashSet, BTreeMap, BTreeSet, etc... That lives on the stack. It's a good choic

Displays 9-Patch UI elements in Bevy
Displays 9-Patch UI elements in Bevy

Bevy 9-Patch plugin Implementation of 9-patch images in Bevy. Let you have a UI that scale only the right parts of your images. See the examples for w

An iterator adapter to peek at future elements without advancing the cursor of the underlying iterator.

multipeek An iterator adapter to peek at future elements without advancing the cursor of the underlying iterator. Check out the documentation for more

Type erased vector. All elements have the same type.

Type erased vector. All elements have the same type. Designed to be type-erased as far as possible - most of the operations does not know about concre

Peekable iterator that allows to peek the next N elements without consuming them.

peekaboo docs - crates.io Peekable iterator that allows to peek the next N elements without consuming them. It's no_std compatible by default. It also

Rmt - similar to the rm command, but it allows me to save the deleted elements in the trash
Rmt - similar to the rm command, but it allows me to save the deleted elements in the trash

Rmt is similar to the rm command but saves the deleted elements in the trash and restores them. Rmt is written in Rust 🦀

A UI component library for Leptos, based on Tailwind Elements.

leptos-twelements A UI component library for Leptos, based on Tailwind Elements. Installation (for projects using cargo leptos) Use the nightly rust c

Rust Server Components. JSX-like syntax and async out of the box.

RSCx - Rust Server Components RSCx is a server-side HTML rendering engine library with a neat developer experience and great performance. Features: al

Polars is a blazingly fast DataFrames library implemented in Rust using Apache Arrow Columnar Format as memory model.
Polars is a blazingly fast DataFrames library implemented in Rust using Apache Arrow Columnar Format as memory model.

Polars Python Documentation | Rust Documentation | User Guide | Discord | StackOverflow Blazingly fast DataFrames in Rust, Python & Node.js Polars is

Owner
nils
hi, I'm nils
nils
Very minimalist tmux status bar that displays used memory and CPU usage.

woot-bar Ultra minimalist status bar that displays used memory and CPU usage woot-bar is made for tmux but it is compatible with anything that eats st

Nicolas Gryman 3 Dec 27, 2022
WinDbg extension written in Rust to dump the CPU / memory state of a running VM

snapshot A Rust WinDbg extension that takes a snapshot of a running VM. snapshot is a WinDbg extension written in Rust that dumps both the state of a

Axel Souchet 88 Mar 20, 2024
Hypothesis-like property testing for Rust

Proptest Introduction Proptest is a property testing framework (i.e., the QuickCheck family) inspired by the Hypothesis framework for Python. It allow

Jason Lingle 1.1k Jan 1, 2023
Easy-to-use grammar-based black-box fuzzer. Has found dozens of bugs in important targets like Clang, Deno, and rustc.

tree-crasher tree-crasher is an easy-to-use grammar-based black-box fuzzer. It parses a number of input files using tree-sitter grammars, and produces

Langston Barrett 5 Mar 28, 2023
Hatch new projects like a chick coming out of its egg

?? Cargo Hatch Hatch new projects like a chick coming out of its egg. Cargo hatch is a cargo init/cargo new on steroids, allowing complex templates th

Dominik Nakamura 6 Nov 2, 2022
Rust lib for a Vec-like structure that can store different types of different sizes contiguous with each other in memory.

hvec In memory of Anna Harren, who coined the term turbofish - which you'll see a lot of if you use this crate. The main purpose of this crate is the

Vi 2 Oct 23, 2022
A Graph implemented using nothing but `Vec`s in rust

VecGraph A Graph implemented using nothing but Vecs in rust. Details The graph is implemented using two Vecs: nodes and edges. nodes stores "nodes". w

null 1 Jan 27, 2022
figure out who holds the nfts that came out of a candy machine.

Candy Holders This is far from finished, but can: find tokens with a given update authority find holders of those tokens Neither the Rust or Node APIs

ExiledApes 24 Dec 29, 2022
SegVec data structure for rust. Similar to Vec, but allocates memory in chunks of increasing size.

segvec This crate provides the SegVec data structure. It is similar to Vec, but allocates memory in chunks of increasing size, referred to as "segment

Jacob Ryan McCollum 30 Dec 16, 2022
async-alloc-counter measures max allocations in a future invocation

async-alloc-counter measures max allocations in a future invocation see examples/ for usage This allocator can be used as follows: use async_alloc_cou

Geoffroy Couprie 2 Dec 3, 2021