I got really bored an made some interface-memory-manager-thing

As the title says: I got bored and thought it would be funny to make some object-manager that allows you to make reasonably ergonomic lists of dynamically dispatched “objects” without worrying about how do store them.

Personally I dont think theres any real use for this, it’s probably ruins performance and is really just a a bad, un-ziggy thing to do imo, but I’d be interested in opinions or someone telling me if what I’ve created here has an actual name.

You are allocating the objects with an alignment of 1 (align of u8) instead of the actual alignment of the types. It’s not really a problem, except on ancient architectures or weirdly configured arm

2 Likes

Oh yeah you’re right, I’ve never dealt with alignment too much. alignedAlloc should be the correct choice here ig.

I appreciate the advice!

1 Like

I just noticed that its literally not possible to initialize the created “objects” without accessing the ptr

edit: fixed