One of Zig's fundamental beliefs is that allocation can fail, even though allocation succeeds 99.9999% of the time (made up statistic but probably pretty close). Zig would be faster if it didn't check whether allocation failed and didn't pass around allocator pointers. But would it be ...
Steps to Reproduce and Observed Behavior ]$ cat main.c #define _DEFAULT_SOURCE 1 #define _GNU_SOURCE 1 #include <stdlib.h> int main () { char* buffer = malloc(12); buffer = reallocarray(buffer, 1, 13); free(buffer); } This may or may not link, depending on the Zig version, ...
Any pointers would be much appreciated--I can also push the WIP commit if that would be helpful, but I imagine that I'm probably missing something that will be obvious to people more familiar with this part of the codebase. Member mlugg commented Jun 28, 2024 You probably just need to...
came up in regards to#1291recently. In this case, the problem is that the runtime-interface pattern (which is a pointer to a struct of function pointers using@fieldParentPtr()) causes the std.mem.Allocator interface to be unusable at comptime. ...
which in not {#link|optional|Optional Pointers#} and does not have the {#syntax#}allowzero{#endsyntax#} attribute will result in a {#link|Pointer Cast Invalid Null#} panic when runtime safety checks are enabled. 22 changes: 0 additions & 22 deletions 22 doc/langref/test_deprecated...
Pointers are not followed. pub fn eql(a: anytype, b: @TypeOf(a)) bool { const T = @TypeOf(a); switch (@typeInfo(T)) { .@"struct" => |info| { if (info.layout == .@"packed") return a == b; inline for (info.fields) |field_info| { if (!eql(@field(a, field_info...
Why would you want a vector of pointers? Mainly, because LLVM IR supports it, and they're usually pretty good about representing what hardware generally supports. We don't automatically do everything LLVM does, but it's a good null hypothesis. Can you do a vector load from that? Yes you...
:?:?: 0x0 in ??? (???) Mb I'm stupid and don't know how to work with pointers to comptime data, if so, please explain Expected Behavior Run correctlygh0st-work added the bug label Apr 5, 2024 Member Vexu commented Apr 5, 2024 You are returning a pointer to a stack ...
src/codegen/llvm.zig:11684: treates -> treats (generic address space and treates as regular pointers. This is the way that HIP also does it.) lib/std/hash/auto_hash.zig:135: dependant -> dependent (next one so that they're dependant.) lib/std/os/windows/ntstatus.zig:2679: unble ...
This also means that the resource management concept extends beyond just pointers and slices, but byval objects like ArrayList can need resource management too (because they are keeping a pointer/slice behind the scenes). So this leads to putting a comptime function pointer in the type of the...