11 Commits

Author SHA1 Message Date
brendan%mozilla.org
040a610072 Add SetAlphaBounds, TABLE_SIZE, and MIN_ALPHA APIs (103990, r=dbaron, sr=waterson).
git-svn-id: svn://10.0.0.236/trunk@105470 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 05:40:27 +00:00
gerv%gerv.net
13afb6d0f9 Relicensing Round 1, Take 2. Most C-like NPL files -> NPL/GPL/LGPL. Bug 98089.
git-svn-id: svn://10.0.0.236/trunk@104119 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 20:14:13 +00:00
brendan%mozilla.org
9457b2de04 1. Fix jsdhash/pldhash.[ch] so that add/remove cycles for a given k do not
create a long chain of removed sentinels.  Also, when adding k to a table
    where k is not mapped, but where k hashes to a chain that includes removed
    sentinels, recycle the first removed sentinel in the chain for k's entry.
2.  Cache cx->resolving till js_DestroyContext, to avoid high JSDHashTable
    new/destroy overhead in js_LookupProperty.
3.  Add NS_TraceStack to nsTraceMalloc.[ch] and clean the .c file up a bit.


git-svn-id: svn://10.0.0.236/trunk@102796 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-12 06:39:31 +00:00
brendan%mozilla.org
bf20b1ca3d - Add a generation number to JSDHashTable that counts entryStore changes due
to grows, shrinks, and compresses.  This helps JS_DHashTableOperate callers
  who hold returned entry pointers to validate those pointers and avoid having
  to re-lookup an entry by its key.
- Balance that addition by removing JSDHashTable.sizeMask, which is induced by
  JSDHashTable.sizeLog2 at the cost of two typically single-cycle instructions.
- Use JSDHashTable.generation in jsobj.c to avoid unsafely dereferencing an
  entry pointer held across calls to JSClass.resolve from js_LookupProperty,
  which may recur and add entries to cx->resolving, growing that table and
  invalidating entry pointers held by earlier js_LookupProperty activations.
(bug 78121, r=jst@netscape.com, sr=jband@netscape.com, a=asa@mozilla.org)


git-svn-id: svn://10.0.0.236/trunk@95896 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-25 03:05:38 +00:00
brendan%mozilla.org
8425d31606 Fix ChangeTable and how it's called (74883, r=gordon, sr=waterson, mcafee approved).
git-svn-id: svn://10.0.0.236/trunk@95146 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-16 21:41:52 +00:00
anthonyd%netscape.com
6e8975b97d Patch around ChangeTable bug (brendan, r=gordon, smoketestblocker).
git-svn-id: svn://10.0.0.236/trunk@95067 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-15 23:41:32 +00:00
brendan%mozilla.org
d5037366b0 Add optional JSDHashTableOps.initEntry hook, spruce up comments (74883, r=waterson, sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@95050 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-15 21:07:10 +00:00
waterson%netscape.com
03cb2db790 Bug 73540. Make sure [JS|PL]DHashTable clear live entries while finalizing. Remove induction variable from [JS|PL]_DHashEnumerate() along the way. r=brendan, sr=shaver
git-svn-id: svn://10.0.0.236/trunk@90488 18797224-902f-48f8-a5cc-f745e15eee43
2001-03-27 06:24:25 +00:00
brendan%mozilla.org
47c8105e26 Fix bug 69271, r=waterson, sr=shaver:
- Don't ape java.lang.String's bogo-sampling hash function for "long" (>=16
  char) strings.
- Theory and practice comment in pldhash.h helps analyze when to use double
  hashing (most of the time) vs. when to use chaining.
- Subroutine ChangeTable from PL_DHashTableOperate so it can be called from
  PL_DHashTableEnumerate, if the latter finds that enough entries have been
  removed to be worth a shrink or compress cycle.


git-svn-id: svn://10.0.0.236/trunk@89639 18797224-902f-48f8-a5cc-f745e15eee43
2001-03-14 07:48:07 +00:00
brendan%mozilla.org
096321676e Forgot to round capacity up to nearest power of two\! r=bienvenu.
git-svn-id: svn://10.0.0.236/trunk@77727 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-31 03:12:40 +00:00
brendan%mozilla.org
60a4bf738f Add pldhash.[ch], sed-translated from js/src/jsdhash.[ch].
git-svn-id: svn://10.0.0.236/trunk@77631 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-30 19:32:03 +00:00