some fixes
This commit is contained in:
parent
538896f0a3
commit
a58740c4ee
2 changed files with 13 additions and 3 deletions
|
@ -422,6 +422,7 @@ hard_alloc(piece, size)
|
||||||
case ALLOSYMB:
|
case ALLOSYMB:
|
||||||
case ALLOARCH:
|
case ALLOARCH:
|
||||||
case ALLOMODL:
|
case ALLOMODL:
|
||||||
|
case ALLORANL:
|
||||||
break; /* Do not try to deallocate this. */
|
break; /* Do not try to deallocate this. */
|
||||||
default:
|
default:
|
||||||
dealloc(i);
|
dealloc(i);
|
||||||
|
@ -499,8 +500,16 @@ core_free(piece, p)
|
||||||
char *q = address(piece, mems[piece].mem_full);
|
char *q = address(piece, mems[piece].mem_full);
|
||||||
|
|
||||||
assert(p < q);
|
assert(p < q);
|
||||||
mems[piece].mem_full -= ((ind_t)q - (ind_t)p);
|
switch(sizeof(unsigned) == sizeof(char *)) {
|
||||||
mems[piece].mem_left += ((ind_t)q - (ind_t)p);
|
case 1:
|
||||||
|
mems[piece].mem_full -= (unsigned) (q - p);
|
||||||
|
mems[piece].mem_left += (unsigned) (q - p);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
mems[piece].mem_full -= (ind_t) q - (ind_t) p;
|
||||||
|
mems[piece].mem_left += (ind_t) q - (ind_t) p;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -21,9 +21,10 @@
|
||||||
#define ALLORANL (ALLOMODL + 1) /* Ranlib information. */
|
#define ALLORANL (ALLOMODL + 1) /* Ranlib information. */
|
||||||
#define NMEMS (ALLORANL + 1)
|
#define NMEMS (ALLORANL + 1)
|
||||||
|
|
||||||
typedef long ind_t;
|
|
||||||
#define BADOFF ((ind_t)-1)
|
#define BADOFF ((ind_t)-1)
|
||||||
|
|
||||||
|
typedef long ind_t;
|
||||||
|
|
||||||
struct memory {
|
struct memory {
|
||||||
char *mem_base;
|
char *mem_base;
|
||||||
ind_t mem_full;
|
ind_t mem_full;
|
||||||
|
|
Loading…
Add table
Reference in a new issue