vorner / bumpalo-herd

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

Are collections supported? #12

Closed kaphula closed 5 months ago

kaphula commented 5 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);
}