mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-27 10:52:59 +00:00
Avoid unnecessary dynamic allocation when calling script functions.
Use tracer instead of rooting in ValueCloner, to avoid memory allocations. This was SVN commit r7770.
This commit is contained in:
@@ -42,4 +42,9 @@ void AutoGCRooter::Trace(JSTracer* trc)
|
||||
{
|
||||
JS_CALL_OBJECT_TRACER(trc, m_Objects[i], "AutoGCRooter object");
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_Vals.size(); ++i)
|
||||
{
|
||||
JS_CALL_VALUE_TRACER(trc, m_Vals[i], "AutoGCRooter val");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user