HAL_Linux: always report 256k of available memory

This commit is contained in:
Andrew Tridgell 2015-11-05 16:06:15 +11:00
parent 567ea0e420
commit 883ac59e4a
2 changed files with 13 additions and 0 deletions

View File

@ -100,4 +100,15 @@ bool Util::is_chardev_node(const char *path)
return S_ISCHR(st.st_mode);
}
/*
always report 256k of free memory. Using mallinfo() isn't useful as
it only reported the current heap, which auto-expands. What we're
trying to do here is ensure that code which checks for free memory
before allocating objects does allow the allocation
*/
uint32_t Util::available_memory(void)
{
return 256*1024;
}
#endif // CONFIG_HAL_BOARD == HAL_BOARD_LINUX

View File

@ -38,6 +38,8 @@ public:
bool is_chardev_node(const char *path);
void set_imu_temp(float current);
uint32_t available_memory(void) override;
private:
static Linux::ToneAlarm _toneAlarm;
Linux::Heat *_heat;