ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

Fix crashes when vkAllocateMemory fails

Open Upliner opened this issue 1 year ago • 3 comments

When system doesn't have enough VRAM, vkAllocateMemory fails and my app crashes. This patch fixes this by always checking return value of allocate_memory and allocate_dedicated_memory so my app can properly report error instead of crashing.

Upliner avatar Oct 21 '24 19:10 Upliner

Codecov Report

:x: Patch coverage is 15.62500% with 27 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 95.87%. Comparing base (aad2e0c) to head (d5ab802). :warning: Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/allocator.cpp 15.62% 27 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5754      +/-   ##
==========================================
+ Coverage   95.84%   95.87%   +0.03%     
==========================================
  Files         837      837              
  Lines      264899   264931      +32     
==========================================
+ Hits       253889   254001     +112     
+ Misses      11010    10930      -80     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Nov 07 '24 02:11 codecov-commenter

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: Upliner
:x: nihui
You have signed the CLA already but the status is still pending? Let us recheck it.

tencent-adm avatar Aug 29 '25 15:08 tencent-adm

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 15155464 15155464 0 :kissing_heart:
armhf 6182208 6182336 +128 :warning:
aarch64 9520608 9454976 -65632 :kissing_heart:

github-actions[bot] avatar Aug 29 '25 15:08 github-actions[bot]