mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-29 16:37:03 +00:00
PowerPC recompiler rework (#641)
This commit is contained in:
parent
06233e3462
commit
b089ae5b32
54 changed files with 15433 additions and 12397 deletions
|
|
@ -44,10 +44,9 @@ public:
|
|||
|
||||
void add(std::string_view appendedStr)
|
||||
{
|
||||
size_t remainingLen = this->limit - this->length;
|
||||
size_t copyLen = appendedStr.size();
|
||||
if (remainingLen < copyLen)
|
||||
copyLen = remainingLen;
|
||||
if (this->length + copyLen + 1 >= this->limit)
|
||||
_reserve(std::max<uint32>(this->length + copyLen + 64, this->limit + this->limit / 2));
|
||||
char* outputStart = (char*)(this->str + this->length);
|
||||
std::copy(appendedStr.data(), appendedStr.data() + copyLen, outputStart);
|
||||
length += copyLen;
|
||||
|
|
@ -80,6 +79,13 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
void _reserve(uint32 newLimit)
|
||||
{
|
||||
cemu_assert_debug(newLimit > length);
|
||||
this->str = (uint8*)realloc(this->str, newLimit + 4);
|
||||
this->limit = newLimit;
|
||||
}
|
||||
|
||||
uint8* str;
|
||||
uint32 length; /* in bytes */
|
||||
uint32 limit; /* in bytes */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue