❌ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayNews from the Ada programming language world

Opening a file Ada.Text_IO.Open (...) using GNAT compiler makes a heap allocation

24 December 2022 at 13:48

While doing advent of code challenges and making sure the solutions do not make any heap allocations during run-time except for application start up (elaboration time), I’ve discovered that opening a file with Ada.Text_IO.Open (…) generates a heap allocation. It means that if one does not closes the file, either deliberately or by mistake due to raising of an exception not only would make an application leak file handles but also memory.

One may wonder about why this is so. I did not expect a heap allocation opening a file. Maybe this is applies only to the implementation of the standard library Ada.Text_IO package of the GNAT compiler, but not for example to the Ada.Streams.Stream_IO package (I haven’t checked!). One reason that I can imagine is usage of Taft Types (Opaque types). It means a File_Type is defined in the public part of the specification package of Text_IO but the exact details of File_Type is defined in the body of the Text_IO package. It is smart because one only needs to replace the body of Text_IO package when porting the standard library to another platform or operating system. The down side is that Taft Types, introduced in Ada83, is closely connected with heap allocations (my experience is that it is hard to avoid heap allocations when using Taft Types).

Any other reason for making heap allocation when opening file?

5 posts - 4 participants

Read full topic

Announcing Ada binding to the wolfSSL library

3 August 2023 at 20:57

On the WolfSSL blog I saw the following announcement today:

Today we are happy to announce the availability of an Ada/SPARK binding that enables Ada applications to use post-quantum TLS 1.3 encryption through the wolfSSL embedded SSL/TLS library.

It opens the door to obtaining FIPS 140-3 and DO-178C certifications for Ada and Spark applications that use TLS for their encrypted communications and also makes them quantum-safe.

Check out the Ada/SPARK binding on GitHub here: https://github.com/wolfSSL/wolfssl/tree/master/wrapper/Ada

The Ada port is suitable for anything from IoT, embedded systems to Desktop and Cloud systems.

Contact us at [email protected], or call us at +1 425 245 8247 with any questions, comments, or suggestions.

URL to blog post:
https://www.wolfssl.com/announcing-ada-binding-to-the-wolfssl-library/

1 post - 1 participant

Read full topic

❌
❌