File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,8 +76,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7676#ifndef likely
7777#ifdef __GNUC__
7878#define likely (x ) __builtin_expect(!!(x), 1)
79+ #define unlikely (x ) __builtin_expect(!!(x), 0)
7980#else
8081#define likely (x ) (x)
82+ #define unlikely (x ) (x)
8183#endif
8284#endif
8385
@@ -3097,7 +3099,7 @@ void blas_memory_free(void *free_area){
30973099 if (memory [position ].addr != free_area ) goto error ;
30983100 printf (" Position : %d\n" , position );
30993101#endif
3100- if (memory_overflowed ) {
3102+ if (unlikely ( memory_overflowed && position >= NUM_BUFFERS ) ) {
31013103 while ((position < NUM_BUFFERS + 512 ) && (newmemory [position - NUM_BUFFERS ].addr != free_area ))
31023104 position ++ ;
31033105 // arm: ensure all writes are finished before other thread takes this memory
You can’t perform that action at this time.
0 commit comments