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
cduce
cduce
Commits
c10d9e2e
Commit
c10d9e2e
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2003-01-12 20:40:54 by cvscast] Empty log message
Original author: cvscast Date: 2003-01-12 20:40:54+00:00
parent
cbd9371b
Changes
1
Hide whitespace changes
Inline
Side-by-side
misc/pool.ml
View file @
c10d9e2e
...
...
@@ -20,21 +20,21 @@ struct
type
t
=
int
type
value
=
H
.
t
let
cache
=
Hashtbl
.
create
63
let
cache
=
State
.
ref
"Pool.cache"
(
Hashtbl
.
create
63
)
let
values
=
State
.
ref
"Pool.values"
(
Array
.
create
63
None
)
let
counter
=
State
.
ref
"Pool.counter"
0
let
clear
()
=
Hashtbl
.
clear
cache
;
Hashtbl
.
clear
!
cache
;
values
:=
Array
.
create
63
None
;
counter
:=
0
let
mk
x
=
try
Hashtbl
.
find
cache
x
try
Hashtbl
.
find
!
cache
x
with
Not_found
->
let
n
=
!
counter
in
incr
counter
;
Hashtbl
.
add
cache
x
n
;
Hashtbl
.
add
!
cache
x
n
;
if
(
n
=
Array
.
length
!
values
)
then
(
let
new_values
=
Array
.
create
(
2
*
Array
.
length
!
values
)
None
in
...
...
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