Subject:
|
Re: anyone know how to check free space on RCX?
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Fri, 12 Jul 2002 18:58:23 GMT
|
Viewed:
|
2371 times
|
| |
| |
> #define MM_HEADER_SIZE 2 //!< 2 words header: pid, size
> Why would the memory manager use all ints when 32bit math is so much
> slower on an h8? I feel like i'm missing something.
>
> This is another reason why 32-bit ints make no sense; int is almost never
> a size that isn't native to the processor. So either you misread the
> header or... I guess I don't quite understand. Any comments on that?
The header is ok, but int is 2 bytes = 16 bit. You can check this with this
highly optimized program:
#include <conio.h>
int main(int argc, char *argv[])
{
lcd_int( sizeof( int ) );
for(;;)
;
return 0;
}
And in the kernel sources, mm.c says the following:
//
// memory block structure:
// 0 1 : pid of owner (0=empty)
// 2 3 : size of data block >> 1
// 4 ... 4+2n: data
//
pid and size are 2 byte values.
Regards,
Michael
|
|
Message has 1 Reply:
Message is in Reply To:
13 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|