Open Lzzzzzt opened 2 months ago
should these accessor like BlockingAccessor
that doesn't store the metadata but change the capability add a field to store the new metadata to avoid needless memory allocation.
Looks good to me, we can construct the info during build time.
It seems that after apply this change, the c binding CI test will fail, but I don't know why this happens.
Feature Description
Since the
CompleteAccessor
stores the metadata, andAccess::info
return theArc<AccessorInfo>
, we can move logic fromfn metadata(&self) -> Arc<AccessorInfo>
toimpl<A: Access> Layer<A> for CompleteLayer
to avoid creating a newArc<AccessorInfo>
(this is not add the reference count).Problem and Solution
just change
CompleteAccessor::metadata
:to
and change
CompleteLayer::layer
:to
Additional Context
All the layers that store the metadata can apply this change.
Are you willing to contribute to the development of this feature?