mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1037264 - Add an 8-bit short-lived string cache. r=neil
This commit is contained in:
parent
a6be42fa2f
commit
334ef7dc92
@ -2324,10 +2324,7 @@ CallMethodHelper::CleanupParam(nsXPTCMiniVariant& param, nsXPTType& type)
|
||||
break;
|
||||
case nsXPTType::T_UTF8STRING:
|
||||
case nsXPTType::T_CSTRING:
|
||||
{
|
||||
nsCString* rs = (nsCString*)param.val.p;
|
||||
delete rs;
|
||||
}
|
||||
nsXPConnect::GetRuntimeInstance()->mScratchCStrings.Destroy((nsCString*)param.val.p);
|
||||
break;
|
||||
default:
|
||||
MOZ_ASSERT(!type.IsArithmetic(), "Cleanup requested on unexpected type.");
|
||||
@ -2355,7 +2352,7 @@ CallMethodHelper::AllocateStringClass(nsXPTCVariant* dp,
|
||||
if (type_tag == nsXPTType::T_ASTRING || type_tag == nsXPTType::T_DOMSTRING)
|
||||
dp->val.p = nsXPConnect::GetRuntimeInstance()->mScratchStrings.Create();
|
||||
else
|
||||
dp->val.p = new nsCString();
|
||||
dp->val.p = nsXPConnect::GetRuntimeInstance()->mScratchCStrings.Create();
|
||||
|
||||
// Check for OOM, in either case.
|
||||
if (!dp->val.p) {
|
||||
|
@ -593,6 +593,7 @@ public:
|
||||
~XPCJSRuntime();
|
||||
|
||||
ShortLivedStringBuffer<nsString> mScratchStrings;
|
||||
ShortLivedStringBuffer<nsCString> mScratchCStrings;
|
||||
|
||||
void AddGCCallback(xpcGCCallback cb);
|
||||
void RemoveGCCallback(xpcGCCallback cb);
|
||||
|
Loading…
Reference in New Issue
Block a user