diff --git a/vunit/vhdl/check/src/checker_pkg-body.vhd b/vunit/vhdl/check/src/checker_pkg-body.vhd index 9b28a5bd3..68f64ace7 100644 --- a/vunit/vhdl/check/src/checker_pkg-body.vhd +++ b/vunit/vhdl/check/src/checker_pkg-body.vhd @@ -152,6 +152,7 @@ package body checker_pkg is check_result.p_msg := new_string_ptr(string_pool, p_std_msg(std_fail_msg, msg, std_fail_ctx)); end if; + deallocate(location); return check_result; end; diff --git a/vunit/vhdl/logging/src/location_pkg-body-2008m.vhd b/vunit/vhdl/logging/src/location_pkg-body-2008m.vhd index 3faea8933..b9e5beaee 100644 --- a/vunit/vhdl/logging/src/location_pkg-body-2008m.vhd +++ b/vunit/vhdl/logging/src/location_pkg-body-2008m.vhd @@ -13,4 +13,9 @@ package body location_pkg is return result; end; + + procedure deallocate(variable location : inout location_t) is + begin + deallocate(location.file_name); + end; end package body; diff --git a/vunit/vhdl/logging/src/location_pkg-body-2019p.vhd b/vunit/vhdl/logging/src/location_pkg-body-2019p.vhd index 67d2a32ea..0bb5f6158 100644 --- a/vunit/vhdl/logging/src/location_pkg-body-2019p.vhd +++ b/vunit/vhdl/logging/src/location_pkg-body-2019p.vhd @@ -29,4 +29,9 @@ package body location_pkg is swrite(result.file_name, ""); return result; end; + + procedure deallocate(variable location : inout location_t) is + begin + deallocate(location.file_name); + end; end package body; diff --git a/vunit/vhdl/logging/src/location_pkg.vhd b/vunit/vhdl/logging/src/location_pkg.vhd index 5808fe0e8..a10311a2d 100644 --- a/vunit/vhdl/logging/src/location_pkg.vhd +++ b/vunit/vhdl/logging/src/location_pkg.vhd @@ -12,4 +12,5 @@ package location_pkg is end record; impure function get_location(path_offset, line_num : natural; file_name : string) return location_t; + procedure deallocate(variable location : inout location_t); end package; diff --git a/vunit/vhdl/logging/src/logger_pkg-body.vhd b/vunit/vhdl/logging/src/logger_pkg-body.vhd index ca01a4f07..bb7d51fd1 100644 --- a/vunit/vhdl/logging/src/logger_pkg-body.vhd +++ b/vunit/vhdl/logging/src/logger_pkg-body.vhd @@ -889,6 +889,7 @@ package body logger_pkg is begin if logger = null_logger then core_failure("Attempt to log to uninitialized logger"); + deallocate(location); return; end if; @@ -913,6 +914,8 @@ package body logger_pkg is -- Count even if disabled count_log(logger, log_level); end if; + + deallocate(location); end procedure; procedure debug(logger : logger_t;