zls
zls copied to clipboard
d3d12.zig - huge memory leak and stall
ZLS+VSCode+win10, when loading info (mouse hover) for some functions in your codebase (mostly related to d3d12.zig) zls eats huge amounts of ram & doesn't load info, stalls into lookup for entire project until editor reload. Happens on 2 separate PCs.
File is here: https://github.com/michal-z/zig-gamedev/blob/main/libs/win32/d3d12.zig
It defines a lot of COM interfaces in Zig like below:
pub const IPipelineState = extern struct {
const Self = @This();
v: *const extern struct {
unknown: IUnknown.VTable(Self),
object: IObject.VTable(Self),
devchild: IDeviceChild.VTable(Self),
pageable: IPageable.VTable(Self),
pstate: VTable(Self),
},
usingnamespace IUnknown.Methods(Self);
usingnamespace IObject.Methods(Self);
usingnamespace IDeviceChild.Methods(Self);
usingnamespace IPageable.Methods(Self);
usingnamespace Methods(Self);
fn Methods(comptime T: type) type {
return extern struct {
pub inline fn GetCachedBlob(self: *T, blob: **d3d.IBlob) HRESULT {
return self.v.pstate.GetCachedBlob(self, blob);
}
};
}
fn VTable(comptime T: type) type {
return extern struct {
GetCachedBlob: fn (*T, **d3d.IBlob) callconv(WINAPI) HRESULT,
};
}
};