vorner / bumpalo-herd

Trying to create Sync bump allocator
Apache License 2.0
28 stars 5 forks source link

Are collections supported? #12

Closed kaphula closed 7 months ago

kaphula commented 7 months ago

Are collections supported?

Is this the correct way to use them, it seems to work:

struct MyStruct {
    a: usize,
    b: usize,
}
let bvec: &mut Vec<MyStruct> = gr.bumpalo_herd.get().alloc(vec![]);
bvec.push(MyStruct {
    a: 12,
    b: 53,
});
for x in bvec {
    println!("{}/{}", x.a, x.b);
}