@wolf480pl Yup.
Or, well, it could be considered "safety-checked undefined behavior", of which Zig has more. The general purpose allocator in the standard library reliably catches this error at runtime.
@wolf480pl Yup.
Or, well, it could be considered "safety-checked undefined behavior", of which Zig has more. The general purpose allocator in the standard library reliably catches this error at runtime.
@ayo I'm guessing this is especially treacherous because not all allocators care about the size passed to free?
Minor Zig footgun: casting a [:0]T to []T is not safe if you need to free that slice later on - the size passed to free will be off by one.
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.