diff options
Diffstat (limited to 'src/synth/elab-vhdl_objtypes.adb')
-rw-r--r-- | src/synth/elab-vhdl_objtypes.adb | 12 |
1 files changed, 12 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; |