Hmm, the malloc version returns 318, if I replace the memoryTest function with the following I get 381. I suspect the stack pointer version is not as future proof or accurate though. But it may still be useful enough. Your *10 malloc version also highlights the fact that the free memory may not be contiguous, since that returns only 170 bytes free when retrieved in 10 byte chunks.
Code:
extern int __bss_end;
extern int *__brkval;
int memoryTest(){
int free_memory;
if((int)__brkval == 0)
free_memory = ((int)&free_memory) - ((int)&__bss_end);
else
free_memory = ((int)&free_memory) - ((int)__brkval);
return free_memory;
}