hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.7K
active users

#memorysafety

5 posts4 participants0 posts today
Continued thread

"Unsafe is the stupidest language feature (on a technical level)", Nadri says. It's just an arbitrary constraint to call code with the unsafe keyword, with only the unsafe keyword. Therefore, it's mostly a social that "works super well".

I have a question about #memorysafety in #zig.

What are the risks in this code?

// using Zig's ReleaseSafe mode
const mem = try std.fmt.allocPrint(std.heap.page_allocator, "Hello {s}", .{"World"});
std.debug.print("text is {s}\n", .{mem});
std.heap.page_allocator.free(mem);
std.debug.print("text is {s}\n", .{mem}); // a programming error occurred here

#RemiPommarel found and fixed a bug/regression in a recent change someone had added to @batadv in the #Linux #kernel. One take home message from Remi:

"On a side note, I am all about #hardening and #MemorySafety stuff but if that means impacting readability and spending more time trying to please the tool than thinking about the #correctness of the code change, that's where we end up converting a perfectly fine #code into a logically flawed one."
(hash tags added by me)

patchwork.open-mesh.org/projec

patchwork.open-mesh.orgbatman-adv: Fix incorrect offset in batadv_tt_tvlv_ogm_handler_v1() - Patchwork

Google just took a big step forward in C++ safety. By retrofitting spatial memory safety onto their C++ code, they've improved security across services like Gmail & YouTube with minimal performance impact. David Cassel dives in more in his article.

thenewstack.io/google-retrofit

The New Stack · Google 'Retrofits' Spatial Memory Safety Onto C++Google researchers showed they were able to "retrofit" spatial safety onto their C++ codebases, and to do it with a surprisingly low impact on performance.