Version française
Home     About     Download     Resources     Contact us    
Browse thread
Ask for a more efficient way to deallocate memory
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Fabrice.Pardo@l...
Subject: Ask for a more efficient way to deallocate memory
Hello,

As the function
Unix.opendir returns a value,
we can expect that Unix.closedir will be automatically
called when


Calling Unix.opendir too many times

I'm looking for a more efficient code than this one

let safe_opendir path =
  let _ = Gc.major ()
  and d = Unix.opendir path
  in Gc.finalise Unix.closedir d