RAMEND bug in HardwareSerial.cpp?

Do you think the original programmer meant to use RAMSIZE rather than RAMEND?

My suspicion is that RAMEND was used because of an eccentricity in the the header files. There's an E2END (EEPROM_END) but no E2SIZE. If the developer was familiar with the EEPROM constant, I can see how one would assume there is a RAMEND but no RAMSIZE.

It does seem to be a bug to compare a memory address with a number. RAMSIZE would be the actual memory size,

I agree. RAMSIZE is the correct constant to use.

RAMEND just happens to be the last address and could be anywhere depending on the internal memory map.

I believe on the AVR processors, RAMEND is always RAMSIZE - 1.

Bug or not it would be nice to use a smaller buffer on processors with 1K of RAM.

Size?