aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2021-05-06 18:33:21 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2021-05-12 11:24:49 +0200
commitcd7b5a37186332e90fee91dd366cba46e3c29ca0 (patch)
tree547ad7d4a3d3234a429f6993a7ebf52dc50049df /src/Module.zig
parentc0369575218d3dccb69f62495de31c8e22d41ae9 (diff)
downloadzig-cd7b5a37186332e90fee91dd366cba46e3c29ca0.tar.gz
zig-cd7b5a37186332e90fee91dd366cba46e3c29ca0.zip
std/mem: add sliceTo(), deprecate spanZ(), lenZ()
The current spanZ() function will not scan for a 0 terminator if the type is not 0 terminated. This encourages using 0 terminated array types to bind C arrays which hold 0 terminated strings. However, this is a big footgun as nothing in the C type system guarantees there to be a 0 terminator at the end of the array and if there is none this becomes Illegal Behavior in Zig. To solve this, deprecate spanZ() and lenZ(), adding a new sliceTo() function that always scans for the given terminator even if the type is not sentinel terminated.
Diffstat (limited to 'src/Module.zig')
0 files changed, 0 insertions, 0 deletions