T
Tricky
Guest
I have the following in my code:
type img_2d_ptr is access image_grey_2D_t;
type image_array_t is array(natural range <>
of img_2d_ptr;
shared variable PIP_IMAGES : image_array_t(PIP_REGISTERS'range) :=
read_PIP_images;
procedure destroy_images( variable x : in image_array_t ) is
begin
for i in x'range loop
DEALLOCATE( x(i) );
end loop;
end procedure destroy_images;
The pass by reference/value is quite important here, because I need to
actually make sure the images are actually deallocated, and it doesnt
deallocate just a copy of them.
Would it just be safer to ignore the input on the procedure and just
deallocate the PIP_IMAGES shared variable directly?
type img_2d_ptr is access image_grey_2D_t;
type image_array_t is array(natural range <>
shared variable PIP_IMAGES : image_array_t(PIP_REGISTERS'range) :=
read_PIP_images;
procedure destroy_images( variable x : in image_array_t ) is
begin
for i in x'range loop
DEALLOCATE( x(i) );
end loop;
end procedure destroy_images;
The pass by reference/value is quite important here, because I need to
actually make sure the images are actually deallocated, and it doesnt
deallocate just a copy of them.
Would it just be safer to ignore the input on the procedure and just
deallocate the PIP_IMAGES shared variable directly?