mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-06 06:22:33 +00:00
Don't clear memory gratuitously (after create-error; after destroy).
This commit is contained in:
parent
21e5ef59a2
commit
725ff208a6
@ -127,10 +127,8 @@ JS_DHashTableInit(JSDHashTable *table, JSDHashTableOps *ops, void *data,
|
||||
table->entryCount = table->removedCount = 0;
|
||||
nbytes = capacity * entrySize;
|
||||
table->entryStore = ops->allocTable(table, nbytes);
|
||||
if (!table->entryStore) {
|
||||
memset(table, 0, sizeof *table);
|
||||
if (!table->entryStore)
|
||||
return JS_FALSE;
|
||||
}
|
||||
memset(table->entryStore, 0, nbytes);
|
||||
METER(memset(&table->stats, 0, sizeof table->stats));
|
||||
return JS_TRUE;
|
||||
@ -141,7 +139,6 @@ JS_DHashTableFinish(JSDHashTable *table)
|
||||
{
|
||||
table->ops->finalize(table);
|
||||
table->ops->freeTable(table, table->entryStore);
|
||||
memset(table, 0, sizeof *table);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user