|
|
Log in / Subscribe / Register

Cro: Maintain it With Zig

Cro: Maintain it With Zig

Posted Sep 11, 2021 3:24 UTC (Sat) by dvdeug (subscriber, #10998)
In reply to: Cro: Maintain it With Zig by Cyberax
Parent article: Cro: Maintain it With Zig

I don't know about guides. It just basically calls pointers access variables, and initalizes them with "new" and you have to make a free function with the generic package Ada.Unchecked_Deallocation, so it's little more sophisticated than C on this. (The clunky free function name is apparently because they assumed everyone would using garbage collection in the future in 1980, so deallocating memory needed to be marked. In practice, except for a couple short-lived JVM or .NET ports, nobody has ever used GC with Ada.) There's object finalization, so you can hide it behind objects that will automatically deallocate the memory when leaving scope, and storage pools, so you can control where memory for certain types gets allocated from, but by and large, it's like C, with all the potential use-after-free errors.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds