mirror of https://github.com/PCSX2/pcsx2.git
recompilers: always allocate the first block
Avoid several annoying SIGSEGV at startup
This commit is contained in:
parent
a4a0b42f8f
commit
26774a2fe0
|
@ -247,6 +247,11 @@ public:
|
||||||
m_blocksize = (bytes + __pagesize - 1) / __pagesize;
|
m_blocksize = (bytes + __pagesize - 1) / __pagesize;
|
||||||
return m_blocksize * __pagesize;
|
return m_blocksize * __pagesize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void Reset()
|
||||||
|
{
|
||||||
|
_parent::Reset();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
|
@ -73,9 +73,23 @@ void* RecompiledCodeReserve::Reserve( size_t size, uptr base, uptr upper_bounds
|
||||||
{
|
{
|
||||||
if (!_parent::Reserve(size, base, upper_bounds)) return NULL;
|
if (!_parent::Reserve(size, base, upper_bounds)) return NULL;
|
||||||
_registerProfiler();
|
_registerProfiler();
|
||||||
|
|
||||||
|
// Pre-Allocate the first block (to reduce the number of segmentation fault
|
||||||
|
// in debugger)
|
||||||
|
DoCommitAndProtect(0);
|
||||||
|
|
||||||
return m_baseptr;
|
return m_baseptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RecompiledCodeReserve::Reset()
|
||||||
|
{
|
||||||
|
_parent::Reset();
|
||||||
|
|
||||||
|
// Pre-Allocate the first block (to reduce the number of segmentation fault
|
||||||
|
// in debugger)
|
||||||
|
DoCommitAndProtect(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Sets the abbreviated name used by the profiler. Name should be under 10 characters long.
|
// Sets the abbreviated name used by the profiler. Name should be under 10 characters long.
|
||||||
// After a name has been set, a profiler source will be automatically registered and cleared
|
// After a name has been set, a profiler source will be automatically registered and cleared
|
||||||
|
|
|
@ -42,6 +42,7 @@ public:
|
||||||
|
|
||||||
virtual void* Reserve( size_t size, uptr base=0, uptr upper_bounds=0 );
|
virtual void* Reserve( size_t size, uptr base=0, uptr upper_bounds=0 );
|
||||||
virtual void OnCommittedBlock( void* block );
|
virtual void OnCommittedBlock( void* block );
|
||||||
|
virtual void Reset();
|
||||||
|
|
||||||
virtual RecompiledCodeReserve& SetProfilerName( const wxString& shortname );
|
virtual RecompiledCodeReserve& SetProfilerName( const wxString& shortname );
|
||||||
virtual RecompiledCodeReserve& SetProfilerName( const char* shortname )
|
virtual RecompiledCodeReserve& SetProfilerName( const char* shortname )
|
||||||
|
|
Loading…
Reference in New Issue