Created
October 13, 2016 07:16
-
-
Save vpodzime/cd8b0e3482aff21e88dd03386a03490a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure Task_Storage_Size is | |
task type My_Task (Id : Natural); -- works just fine without the discriminant | |
task body My_Task is | |
X : Natural := Id; | |
begin | |
X := X ** 10; | |
end; | |
type My_Task_Access is access My_Task | |
with Storage_Size => 4 * My_Task'Max_size_in_storage_elements; | |
type My_Task_Array is array (Natural range <>) of My_Task_Access; | |
Tasks : My_Task_Array (1..4); | |
begin | |
-- raises STORAGE_ERROR : s-poosiz.adb:259 explicit raise | |
for I in Tasks'Range loop | |
Tasks (I) := new My_Task (I); | |
end loop; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I also tested the above with records and it's even worse: