Fixes #1791: Port Lua Bin Allocator to next:

* Bin Allocator
* Lua memory allocaton fixes
* Simulator memory leak fixes
This commit is contained in:
Damjan Adamic
2014-10-26 09:14:45 +01:00
parent 56a4cf5d26
commit c89381bae5
19 changed files with 294 additions and 13 deletions
+20
View File
@@ -323,6 +323,11 @@ void *main_thread(void *)
perMain();
sleep(10/*ms*/);
}
#if defined(LUA)
luaClose();
#endif
#ifdef SIMU_EXCEPTIONS
}
catch (...) {
@@ -396,6 +401,14 @@ void StopEepromThread()
sem_post(eeprom_write_sem);
pthread_join(eeprom_thread_pid, NULL);
#endif
#ifdef __APPLE__
//TODO free semaphore eeprom_write_sem
#else
sem_destroy(eeprom_write_sem);
free(eeprom_write_sem);
#endif
if (fp) fclose(fp);
}
#if defined(PCBTARANIS)
@@ -546,6 +559,13 @@ FRESULT f_opendir (DIR * rep, const TCHAR * name)
return FR_OK;
}
FRESULT f_closedir (DIR * rep)
{
TRACE("f_closedir(%p)", rep);
simu::closedir((simu::DIR *)rep->fs);
return FR_OK;
}
FRESULT f_readdir (DIR * rep, FILINFO * fil)
{
if (!rep->fs) return FR_NO_FILE;