forked from FBoisson/Camllight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
READ.me
34 lines (26 loc) · 875 Bytes
/
READ.me
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Camllight version 0.82-1
Version débuggée. La gestion des pages du heap a été refaite
Camllight version 0.81
Version initiale. Cette vesion comporte un bug dans la gestion de la mémoire
(Branche /src/runtime, essenteiellement fichier memory.c, misc.c, major_gc.c).
Ce bug se manifeste par un Out of memory lors de l'éxécution de
let rec puissance x = function
| 0 -> 1
| 1 -> x
| n when (n mod 2=0) -> let c= (puissance x (n/2)) in c*c
| n -> let c= (puissance x (n/2)) in c*c*x;;
let evalue p x =
let nul = vect_of_list p
and n = list_length p
and res = ref 0
in (
for i = 0 to (n-1) do res:=!res + nul.(i)*(puissance x i);done;
!res
);;
let rec randlist = function
| 0 -> []
| n -> (random__int 1432)::(randlist (n-1));;
let c n = evalue (randlist n) 12;;
for i = 1 to 10 do
(function _ -> ()) (c 131020);
done ;;