r=bz sr=bz
Perhaps an explanation. String concatenation is a chance for garbage collection.
If you have unbounded input, this can be pretty bad. When you start running low
on memory, the garbage collector gets desperate and won't take shortcuts. Worst of
all, the original code generates one string of garbage every iteration starting with
the second or third.
This code uses a=[] to construct an array and a[n] to set the upper array boundary,
0 being the lower, and there are n slots between a[0] and a[n].
join() will build a string with n copies of the join argument, where n is the number of slots between between cells. So for:
a=[]; a[1]=''; there's 1 slot between [0] and [1]. The array's length is actually 2,
but the joined length will be 1.
While it is possible to use new Array(x), the behavior is different because the
array has length x and there are x-1 spaces between cells. This leads to code which
would be both much longer and harder to read. And definitely not particularly
intuitive.
The code used here otoh, while magical will hopefully require you to pause, think,
and quickly understand what's going on. If not, you paused long enough for this
bubble to appear and explain it to you :).
the links in the JS console automatically go to the right line in View Source
(bug 79612). Patch (in bug 104383) by christian@schmidt.net (Christian
Schmidt) with some selection fu from rbs, r=neil, sr=me, a=asa
Changes:
* Added EXTRA_COMPONENTS variable to build. Use it to automagically install files into the components dir.
* Added SYSINSTALL variable. Use it install files onto the system.
* Move mozilla-config generation from configure to makefiles
* mozilla-config will now generate paths based upon the MRE-based directory layout.
* Generate mozilla script from template
The installation heirarchy currently looks like:
$prefix -> /bin/mozilla
/bin/mozilla-config
/include/mozilla-ver/*
/lib/mozilla-ver (mozappdir)
/components
/res
/defaults
/chrome
There is preliminary build support for MRE dirs as well though the component manager hasn't had MRE support added yet.
$prefix -> /lib/mre/mre-ver (mredir)
/components
nsIComponentRegistrar.
2. Converts callers of nsComponentManager::AutoRegister to use
nsIComponentRegistrar's autoRegistrar method.
3. Add nsIComponentRegistrar implmentation to nsComponentManagerImpl.
4. Rearrange nsComponentManager.cpp so that related methods are in the same
place.
5. Added a C-style function NS_GetComponentRegistrar so that getting the
registrar is easier in some places.
6. Added a nsISimpleEnumerator interface on PLDHashTableEnumeratorImpl. in
this way, the same base class can support both old style and new style
enumerations.
7. Fixed a nasty bug where unregistring factories will leave the contract id
hash with a dangling pointer. Now, when unregister is called we search the
contract id hash for entries which have the given doomned cid and remove them.
Bug 115853. r=dp@netscape.com, sr=rpotts@netscape.com
a) create a new nsIComponentManager with only four functions on it:
CreateInstance CreateInstanceByContractID GetClassInfo GetClassInfoByContractID.
b) rename the old nsIComponentManager to nsIComponentManagerObsolete.
c) fixes callers which use to access the nsIComponentManager for component
registration functionality. These callers will temporary use the
nsIComponentManagerObsolete interface.
d) Create a new API NS_GetComponentManager() which mirrors the
NS_GetServiceManager()
e) Perserves the old NS_GetGlobalComponentManager(). Note the cast usage.
r/sr = rpotts@netscape.comalecf@netscape.combrendan@mozilla.org