T
Tricky
Guest
Consider the following:
type a_t;
type a_t_ptr is access a_t;
type b_t;
type b_t_ptr is access b_t;
type a_t is array(integer range <> of integer;
type b_t is array(integer range <> of a_t_ptr;
begin
process
variable P : b_t_ptr;
begin
P := new b_t(1 to 10);
for i in 1 to 10 loop
p(i) = new a_t(1 to 10);
end loop;
DEALLOCATE(P);
wait;
end process;
have I just caused a memory leak by not deallocating all the elements
in the top level array? would you have to quit the simulator to free
it again, or just end the simulation?
type a_t;
type a_t_ptr is access a_t;
type b_t;
type b_t_ptr is access b_t;
type a_t is array(integer range <> of integer;
type b_t is array(integer range <> of a_t_ptr;
begin
process
variable P : b_t_ptr;
begin
P := new b_t(1 to 10);
for i in 1 to 10 loop
p(i) = new a_t(1 to 10);
end loop;
DEALLOCATE(P);
wait;
end process;
have I just caused a memory leak by not deallocating all the elements
in the top level array? would you have to quit the simulator to free
it again, or just end the simulation?