Merge pull request #5618 from lioncash/fifo
FifoRecorder: Don't allocate ~100.7MB on program startup
This commit is contained in:
commit
74cab88a8c
|
@ -18,9 +18,7 @@
|
||||||
static FifoRecorder instance;
|
static FifoRecorder instance;
|
||||||
static std::recursive_mutex sMutex;
|
static std::recursive_mutex sMutex;
|
||||||
|
|
||||||
FifoRecorder::FifoRecorder() : m_Ram(Memory::RAM_SIZE), m_ExRam(Memory::EXRAM_SIZE)
|
FifoRecorder::FifoRecorder() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
FifoRecorder::~FifoRecorder()
|
FifoRecorder::~FifoRecorder()
|
||||||
{
|
{
|
||||||
|
@ -36,6 +34,22 @@ void FifoRecorder::StartRecording(s32 numFrames, CallbackFunc finishedCb)
|
||||||
FifoAnalyzer::Init();
|
FifoAnalyzer::Init();
|
||||||
|
|
||||||
m_File = new FifoDataFile;
|
m_File = new FifoDataFile;
|
||||||
|
|
||||||
|
// TODO: This, ideally, would be deallocated when done recording.
|
||||||
|
// However, care needs to be taken since global state
|
||||||
|
// and multithreading don't play well nicely together.
|
||||||
|
// The video thread may call into functions that utilize these
|
||||||
|
// despite 'end recording' being requested via StopRecording().
|
||||||
|
// (e.g. OpcodeDecoder calling UseMemory())
|
||||||
|
//
|
||||||
|
// Basically:
|
||||||
|
// - Singletons suck
|
||||||
|
// - Global variables suck
|
||||||
|
// - Multithreading with the above two sucks
|
||||||
|
//
|
||||||
|
m_Ram.resize(Memory::RAM_SIZE);
|
||||||
|
m_ExRam.resize(Memory::EXRAM_SIZE);
|
||||||
|
|
||||||
std::fill(m_Ram.begin(), m_Ram.end(), 0);
|
std::fill(m_Ram.begin(), m_Ram.end(), 0);
|
||||||
std::fill(m_ExRam.begin(), m_ExRam.end(), 0);
|
std::fill(m_ExRam.begin(), m_ExRam.end(), 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue