stackitem: reusable serialization context

We serialize items a lot and this allows to avoid a number of allocations.
This commit is contained in:
Roman Khimov 2022-05-31 20:10:20 +03:00
parent 3d4076ca36
commit c3d989ebda
13 changed files with 111 additions and 42 deletions

View file

@ -61,7 +61,7 @@ func Notify(ic *interop.Context) error {
// But it has to be serializable, otherwise we either have some broken
// (recursive) structure inside or an interop item that can't be used
// outside of the interop subsystem anyway.
bytes, err := stackitem.Serialize(elem.Item())
bytes, err := ic.DAO.GetItemCtx().Serialize(elem.Item(), false)
if err != nil {
return fmt.Errorf("bad notification: %w", err)
}