diff options
-rw-r--r-- | src/synth/elab-vhdl_objtypes.adb | 12 | ||||
-rw-r--r-- | src/synth/elab-vhdl_objtypes.ads | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/synth/elab-vhdl_objtypes.adb b/src/synth/elab-vhdl_objtypes.adb index d1d263948..0b876ffeb 100644 --- a/src/synth/elab-vhdl_objtypes.adb +++ b/src/synth/elab-vhdl_objtypes.adb @@ -796,6 +796,18 @@ package body Elab.Vhdl_Objtypes is end loop; end Copy_Memory; + function Unshare (Src : Memtyp; Pool : Areapool_Acc) return Memtyp + is + Prev_Pool : constant Areapool_Acc := Current_Pool; + Res : Memory_Ptr; + begin + Current_Pool := Pool; + Res := Alloc_Memory (Src.Typ); + Copy_Memory (Res, Src.Mem, Src.Typ.Sz); + Current_Pool := Prev_Pool; + return (Src.Typ, Res); + end Unshare; + function Unshare (Src : Memtyp) return Memtyp is Res : Memory_Ptr; diff --git a/src/synth/elab-vhdl_objtypes.ads b/src/synth/elab-vhdl_objtypes.ads index c8797e069..257065e5c 100644 --- a/src/synth/elab-vhdl_objtypes.ads +++ b/src/synth/elab-vhdl_objtypes.ads @@ -300,6 +300,7 @@ package Elab.Vhdl_Objtypes is procedure Copy_Memory (Dest : Memory_Ptr; Src : Memory_Ptr; Sz : Size_Type); function Unshare (Src : Memtyp) return Memtyp; + function Unshare (Src : Memtyp; Pool : Areapool_Acc) return Memtyp; procedure Initialize; procedure Finalize; |