diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index dde608a3bb5..307ec34ceb0 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -366,8 +366,7 @@ nsCheapVoidArray::SwitchToVector() { void* child = GetSingleChild(); - // XXX Probably should be nsAutoVoidArray to avoid extra alloc - check bloat! - mChildren = (void*)new nsVoidArray(); + mChildren = (void*)new nsAutoVoidArray(); nsVoidArray* vector = GetChildVector(); if (vector && child) { vector->AppendElement(child); diff --git a/mozilla/content/xul/document/src/nsXULContentSink.cpp b/mozilla/content/xul/document/src/nsXULContentSink.cpp index a7884a4314d..3572e3c23b3 100644 --- a/mozilla/content/xul/document/src/nsXULContentSink.cpp +++ b/mozilla/content/xul/document/src/nsXULContentSink.cpp @@ -227,8 +227,8 @@ protected: protected: struct Entry { nsXULPrototypeNode* mNode; - // a LOT of nodes have children, but leave for now - nsVoidArray mChildren; + // a LOT of nodes have children; preallocate for 8 + nsAutoVoidArray mChildren; State mState; Entry* mNext; };