Fix unmap logic
This commit is contained in:
parent
7fd12a5e69
commit
89fc5b8f4f
|
@ -76,8 +76,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef likely
|
#ifndef likely
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define likely(x) __builtin_expect(!!(x), 1)
|
#define likely(x) __builtin_expect(!!(x), 1)
|
||||||
|
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||||
#else
|
#else
|
||||||
#define likely(x) (x)
|
#define likely(x) (x)
|
||||||
|
#define unlikely(x) (x)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3097,7 +3099,7 @@ void blas_memory_free(void *free_area){
|
||||||
if (memory[position].addr != free_area) goto error;
|
if (memory[position].addr != free_area) goto error;
|
||||||
printf(" Position : %d\n", position);
|
printf(" Position : %d\n", position);
|
||||||
#endif
|
#endif
|
||||||
if (memory_overflowed) {
|
if (unlikely(memory_overflowed && position >= NUM_BUFFERS)) {
|
||||||
while ((position < NUM_BUFFERS+512) && (newmemory[position-NUM_BUFFERS].addr != free_area))
|
while ((position < NUM_BUFFERS+512) && (newmemory[position-NUM_BUFFERS].addr != free_area))
|
||||||
position++;
|
position++;
|
||||||
// arm: ensure all writes are finished before other thread takes this memory
|
// arm: ensure all writes are finished before other thread takes this memory
|
||||||
|
|
Loading…
Reference in New Issue