mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 13:45:27 +00:00
Bug 711563 - reduce space required by hash entry chains; r=jorendorff
This commit is contained in:
parent
0a1c43dbd0
commit
b19568f2e7
@ -49,7 +49,7 @@
|
||||
|
||||
class XPCCallContext;
|
||||
|
||||
#define XPC_QS_NULL_INDEX ((size_t) -1)
|
||||
#define XPC_QS_NULL_INDEX ((uint16_t) -1)
|
||||
|
||||
struct xpc_qsPropertySpec {
|
||||
const char *name;
|
||||
@ -76,8 +76,8 @@ struct xpc_qsHashEntry {
|
||||
const xpc_qsFunctionSpec *functions;
|
||||
// These last two fields index to other entries in the same table.
|
||||
// XPC_QS_NULL_ENTRY indicates there are no more entries in the chain.
|
||||
size_t parentInterface;
|
||||
size_t chain;
|
||||
uint16_t parentInterface;
|
||||
uint16_t chain;
|
||||
};
|
||||
|
||||
inline nsISupports*
|
||||
|
@ -1235,6 +1235,9 @@ def writeDefiner(f, conf, interfaces):
|
||||
f.write("static const xpc_qsHashEntry tableData[] = {\n")
|
||||
f.write(",\n".join(entries))
|
||||
f.write("\n };\n\n")
|
||||
f.write("// Make sure our table indices aren't overflowed\n"
|
||||
"PR_STATIC_ASSERT((sizeof(tableData) / sizeof(tableData[0])) < (1 << (8 * sizeof(tableData[0].parentInterface))));\n"
|
||||
"PR_STATIC_ASSERT((sizeof(tableData) / sizeof(tableData[0])) < (1 << (8 * sizeof(tableData[0].chain))));\n\n")
|
||||
|
||||
# the definer function (entry point to this quick stubs file)
|
||||
f.write("JSBool %s_DefineQuickStubs(" % conf.name)
|
||||
|
Loading…
Reference in New Issue
Block a user