Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
trackrdrd
Commits
c9c717d7
Commit
c9c717d7
authored
Feb 18, 2013
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trackrdrd: hash_insert without goto
parent
d4d73dfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
+28
-28
child.c
trackrdrd/src/child.c
+28
-28
No files found.
trackrdrd/src/child.c
View file @
c9c717d7
...
...
@@ -499,37 +499,37 @@ static hashentry
uint32_t
h
=
h1
(
xid
);
he
=
&
htbl
.
entry
[
INDEX
(
h
)];
if
(
he
->
state
==
HASH_EMPTY
)
goto
ok
;
htbl
.
collisions
++
;
oldest
=
he
;
h
=
h2
(
xid
);
unsigned
n
=
0
;
do
{
he
=
&
htbl
.
entry
[
INDEX
(
h
)];
probes
++
;
if
(
he
->
state
==
HASH_EMPTY
)
goto
ok
;
if
(
he
->
insert_time
<
oldest
->
insert_time
)
oldest
=
he
;
n
++
;
h
+=
n
*
n
;
}
while
(
probes
<=
htbl
.
max_probes
);
if
(
he
->
state
!=
HASH_EMPTY
)
{
htbl
.
collisions
++
;
oldest
=
he
;
h
=
h2
(
xid
);
unsigned
n
=
0
;
do
{
he
=
&
htbl
.
entry
[
INDEX
(
h
)];
probes
++
;
if
(
he
->
state
==
HASH_EMPTY
)
break
;
if
(
he
->
insert_time
<
oldest
->
insert_time
)
oldest
=
he
;
n
++
;
h
+=
n
*
n
;
}
while
(
probes
<=
htbl
.
max_probes
);
/* none eligible for evacuation */
if
(
he
->
state
!=
HASH_EMPTY
)
{
if
((
oldest
->
insert_time
+
htbl
.
mlt
)
>
t
)
{
htbl
.
fail
++
;
htbl
.
insert_probes
+=
probes
;
return
(
NULL
);
}
/* none eligible for evacuation */
if
((
oldest
->
insert_time
+
htbl
.
mlt
)
>
t
)
{
htbl
.
fail
++
;
htbl
.
insert_probes
+=
probes
;
return
(
NULL
);
hash_evacuate
(
oldest
);
he
=
oldest
;
}
}
hash_evacuate
(
oldest
);
he
=
oldest
;
ok:
htbl
.
insert_probes
+=
probes
;
he
->
state
=
HASH_OPEN
;
...
...
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