Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

refactoring work in nn-hal #117

Open
wants to merge 6 commits into
base: chromeos-gna
Choose a base branch
from

Conversation

jxzgithub
Copy link

Anisha and other maintainers,
These patches are NOT fully tested, so please have a serious look and have someone help to validate them.

We shouldn't need to call allocate() of a blob object if it was
created with the constructor variant which already called
allocate().
Assuming we believe these blobs should be deallocated (likely from
a true returned from allocate()), the adding log will give us a
hint when the unexpected happens, and it does in runtime.
The 'buf' is not used anymore before the function returns,so there
is no need to reset it.
The class member mOpIndex2BlobMap is not really used any more, but
it holds blobs which are shared pointers. There is a potential
case of failing to release the blob resource because of the useless
mOpIndex2BlobMap is still holding it. We'd better get rid of such
unnecessary reference before it becomes a real obscure bug later.
We cannot dereference mBuilderModel when it is null. That surely
will crash the process.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant