Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
ec64e1d7
Commit
ec64e1d7
authored
Sep 02, 2010
by
Roberto Raggi
Browse files
Tune the symbol and the literal tables.
parent
15b0082b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/shared/cplusplus/LiteralTable.h
View file @
ec64e1d7
...
...
@@ -138,7 +138,11 @@ public:
_Literal
*
literal
=
new
_Literal
(
chars
,
size
);
if
(
++
_literalCount
==
_allocatedLiterals
)
{
_allocatedLiterals
+=
32
;
if
(
!
_allocatedLiterals
)
_allocatedLiterals
=
4
;
else
_allocatedLiterals
<<=
1
;
_literals
=
(
_Literal
**
)
std
::
realloc
(
_literals
,
sizeof
(
_Literal
*
)
*
_allocatedLiterals
);
}
...
...
@@ -161,7 +165,11 @@ protected:
if
(
_buckets
)
std
::
free
(
_buckets
);
_allocatedBuckets
+=
32
;
if
(
!
_allocatedBuckets
)
_allocatedBuckets
=
4
;
else
_allocatedBuckets
<<=
1
;
_buckets
=
(
_Literal
**
)
std
::
calloc
(
_allocatedBuckets
,
sizeof
(
_Literal
*
));
_Literal
**
lastLiteral
=
_literals
+
(
_literalCount
+
1
);
...
...
src/shared/cplusplus/Scope.cpp
View file @
ec64e1d7
...
...
@@ -105,7 +105,7 @@ private:
void
rehash
();
private:
enum
{
DefaultInitialSize
=
11
};
enum
{
DefaultInitialSize
=
4
};
Scope
*
_owner
;
Symbol
**
_symbols
;
...
...
@@ -147,7 +147,7 @@ void SymbolTable::enterSymbol(Symbol *symbol)
symbol
->
_scope
=
_owner
;
_symbols
[
_symbolCount
]
=
symbol
;
if
(
_symbolCount
>=
_hashSize
*
0.6
)
if
(
_symbolCount
*
5
>=
_hashSize
*
3
)
rehash
();
else
{
const
unsigned
h
=
hashValue
(
symbol
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment