From 20e4c8fea5063466999739f72b6b671a2faedc99 Mon Sep 17 00:00:00 2001 From: "rjesup%wgate.com" Date: Thu, 27 Sep 2001 22:21:37 +0000 Subject: [PATCH] Bug 92575: Remaining mChildren nsAutoVoidArray changes. r=waterson, sr=jst git-svn-id: svn://10.0.0.236/trunk@104001 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsGenericElement.cpp | 3 +-- mozilla/content/xul/document/src/nsXULContentSink.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) 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; };