align on ints instead of shorts

This commit is contained in:
ceriel 1988-04-25 10:41:33 +00:00
parent e4838a6225
commit 131d4d9454

View file

@ -49,7 +49,7 @@ area_t getarea(size) unsigned size ; {
unsigned rqsize ; unsigned rqsize ;
char *malloc() ; char *malloc() ;
size = ((size + (sizeof(short) - 1)) / sizeof(short)) * sizeof(short); size = ((size + (sizeof(int) - 1)) / sizeof(int)) * sizeof(int);
#ifdef MEMUSE #ifdef MEMUSE
m_used += size ; m_used += size ;
m_free -= size ; m_free -= size ;
@ -72,7 +72,7 @@ area_t getarea(size) unsigned size ; {
ptr = malloc( rqsize ) ; ptr = malloc( rqsize ) ;
if ( ptr ) break ; /* request succesfull */ if ( ptr ) break ; /* request succesfull */
rqsize /= 2 ; rqsize /= 2 ;
rqsize -= rqsize%sizeof (short) ; rqsize -= rqsize%sizeof (int) ;
if ( rqsize < sizeof freehead ) { if ( rqsize < sizeof freehead ) {
fatal("Out of memory") ; fatal("Out of memory") ;
} }
@ -88,7 +88,7 @@ area_t getarea(size) unsigned size ; {
freearea(ptr,size) register area_t ptr ; unsigned size ; { freearea(ptr,size) register area_t ptr ; unsigned size ; {
register struct freeblock *c_ptr, *l_ptr ; register struct freeblock *c_ptr, *l_ptr ;
size = ((size + (sizeof(short) - 1)) / sizeof(short)) * sizeof(short); size = ((size + (sizeof(int) - 1)) / sizeof(int)) * sizeof(int);
#ifdef MEMUSE #ifdef MEMUSE
m_free += size ; m_free += size ;
m_used -= size ; m_used -= size ;