This to me seems like your problem. Because I can’t see the code, I assume you are doing something like this:
var config: EM__CONFIG = std.mem.zeroInit(EM__CONFIG, .{});
If that is the case, the em.Table will be created but the Allocator inside the ArrayList will have a ptr to a zeroInit *anyopaque and a vtable that points to… nothing?
ZeroInit is fine, but you need some way to get an allocator into the Table’s ArrayList somehow. That’s why I suggested the init methods. Or you could set name_tab._list.alloctor = allocator somewhere before adding anything to it. The allocator needs to be set at runtime. I’m not even sure what a comptime allocator would look like.
As far as the logs go, there’s enough there that I don’t think the first call to ensureTotalCapacityPrecise is the one you are interested in. So calling exit may exit before you even hit the case you are looking for.
To Kristoff’s point, using ArrayListUnmanaged could do it. You would have to thread the allocator through from main or somehow set one up in your IntrVec to thread through.
pub fn main() void {
@import(".gen/host.zig").exec(std.heap.c_allocator);
}
// Later in Table
self._list.append(allocator, item);