因此,我正在开发一个不应该从默认池执行分配的ada 2012库;所有这些库都应该使用用户指定的存储池。
我使用了一些预定义的包,其中一些显然不遵守规则:例如不确定的容器。我想确定我没有用我不该用的东西。
我认为一些pragma限制可能会有帮助,但以下这些都没有抱怨:
pragma Restrictions (No_Allocators);
pragma Restrictions (No_Anonymous_Allocators);
pragma Restrictions (No_Implicit_Heap_Allocations);
pragma Restrictions (No_Standard_Allocators_After_Elaboration);
pragma Restrictions (No_Standard_Storage_Pools);
with Ada.Containers.Indefinite_Vectors;
procedure Anon is
package Vectors is new Ada.Containers.Indefinite_Vectors (Positive, String);
V : Vectors.Vector;
begin
V.Append ("Mmm");
end Anon;
我不确定为什么没有或者应该检测到(即使是预编译的,编译器库也应该有包含此信息的.ali文件)。如果没有,有办法吗?
这是在中声明的指针类型
a-coinve.ads
没有任何存储池:
type Elements_Access is access all Elements_Type;
这是用在身体里的
new
.
(编辑以澄清我指的是来自默认池的分配,而不是匿名访问类型)。