Class Weak_memo.c


class [< .. >] c : int -> object .. end
The memo class.

new Weak_memo.c size create a new memo object with an original size of size. It will grow as needed.


method add : (< .. > as 'a) -> unit
Add an object to the memo. This won't prevent this object to be recollected by the Gc.

Do nothing if the object is already there.

method find : 'b. (< .. > as 'b) -> 'a
Find if the object is in the memo. If yes then return it (with the good type).

Otherwise raise Not_found

method mem : 'c. (< .. > as 'c) -> bool
Return true if there is an object in the memo that is equal to the object given as argument. Return false otherwise.
method remove : 'd. (< .. > as 'd) -> unit
Remove an object from the memo. If it is not there, do nothing
method clear : unit -> unit
Empty the memo object.
method count : int
Return the number of object in the memo.