Browse Source

Fix unmap logic

tags/v0.3.18
Martin Kroeker GitHub 4 years ago
parent
commit
89fc5b8f4f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      driver/others/memory.c

+ 3
- 1
driver/others/memory.c View File

@@ -76,8 +76,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef likely
#ifdef __GNUC__
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else
#define likely(x) (x)
#define unlikely(x) (x)
#endif
#endif

@@ -3097,7 +3099,7 @@ void blas_memory_free(void *free_area){
if (memory[position].addr != free_area) goto error;
printf(" Position : %d\n", position);
#endif
if (memory_overflowed) {
if (unlikely(memory_overflowed && position >= NUM_BUFFERS)) {
while ((position < NUM_BUFFERS+512) && (newmemory[position-NUM_BUFFERS].addr != free_area))
position++;
// arm: ensure all writes are finished before other thread takes this memory


Loading…
Cancel
Save