Ada - 从异构列表中释放

问题描述 投票:0回答:1

操StackOverflow,操OpenAI。

memory-management ada circular-list
1个回答
5
投票

Element
Element'Class
是不同的类型, 并且您尝试使用不匹配的类型实例化
Unchecked_Deallocation
。 尝试用
Element'Class
来实例化:

procedure Free is new Ada.Unchecked_Deallocation(Element'Class, ElementPtr);
© www.soinside.com 2019 - 2024. All rights reserved.