Merge pull request #1179 from jcowgill/memory-fixes
Fixes to driver/others/memory.c
This commit is contained in:
commit
6464d1723a
|
@ -1015,7 +1015,7 @@ void *blas_memory_alloc(int procpos){
|
||||||
mypos = WhereAmI();
|
mypos = WhereAmI();
|
||||||
|
|
||||||
position = mypos;
|
position = mypos;
|
||||||
while (position > NUM_BUFFERS) position >>= 1;
|
while (position >= NUM_BUFFERS) position >>= 1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (!memory[position].used && (memory[position].pos == mypos)) {
|
if (!memory[position].used && (memory[position].pos == mypos)) {
|
||||||
|
@ -1164,8 +1164,8 @@ void blas_memory_free(void *free_area){
|
||||||
position = 0;
|
position = 0;
|
||||||
LOCK_COMMAND(&alloc_lock);
|
LOCK_COMMAND(&alloc_lock);
|
||||||
|
|
||||||
while ((memory[position].addr != free_area)
|
while ((position < NUM_BUFFERS) && (memory[position].addr != free_area))
|
||||||
&& (position < NUM_BUFFERS)) position++;
|
position++;
|
||||||
|
|
||||||
if (memory[position].addr != free_area) goto error;
|
if (memory[position].addr != free_area) goto error;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue