Ada.Containers.Functional_Maps 在 Ada2012 中可用吗? [英] Is Ada.Containers.Functional_Maps usable in Ada2012?

查看:24
本文介绍了Ada.Containers.Functional_Maps 在 Ada2012 中可用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于Ada.Containers.Functional_Maps 在 GNAT 文档中相当——比如说——深奥.

The information about Ada.Containers.Functional_Maps in the GNAT documentation is quite—let's say—abstruse.

首先,它是这样说的:

……这些容器仍然可以安全使用.

…these containers can still be used safely.

在第二段中,在我看来,一旦程序退出创建它们的上下文,您就无法释放为这些对象分配的内存.我知道您可能会遇到内存泄漏.我说得对吗?

In the second paragraph, it seems to me that you cannot free the memory allocated for those objects once the program exits the context where they are created. I am understanding that you could run into a memory leak. Am I right?

它们也会消耗内存,因为当容器不再被引用时,分配的内存不会被回收.

They are also memory consuming, as the allocated memory is not reclaimed when the container is no longer referenced.

推荐答案

阅读文档中接下来的两句话:

Read the next two sentences in the doc:

因此,它们通常应该用于幽灵代码和注释中,以便可以从最终的可执行文件中删除它们.本机规格与S​​PARK 2014兼容.

Thus, they should in general be used in ghost code and annotations, so that they can be removed from the final executable. The specification of this unit is compatible with SPARK 2014.

这篇关于Ada.Containers.Functional_Maps 在 Ada2012 中可用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆