(* Example program which uses Net::Google to query Google.
* You will need to have a Google API key in ~/.googlekey for this to work.
* Copyright (C) 2003 Merjis Ltd.
- * $Id: google.ml,v 1.2 2003-10-15 16:51:12 rich Exp $
+ * $Id: google.ml,v 1.3 2003-10-16 11:03:52 rich Exp $
*)
open Printf
) search#results;
(* Destroy the Perl interpreter. *)
- Perl.destroy (Perl.current_interpreter ())
+ Perl.destroy (Perl.current_interpreter ());
+
+ (* Perform a full collection - good way to find GC/allocation bugs. *)
+ Gc.full_major ()
(* Example program which uses LWP::UserAgent and HTML::TreeBuilder to
* download an HTTP page and parse it.
* Copyright (C) 2003 Merjis Ltd.
- * $Id: loadpage.ml,v 1.3 2003-10-15 16:51:12 rich Exp $
+ * $Id: loadpage.ml,v 1.4 2003-10-16 11:03:52 rich Exp $
*)
open Printf
print tree;
(* Destroy the Perl interpreter. *)
- Perl.destroy (Perl.current_interpreter ())
+ Perl.destroy (Perl.current_interpreter ());
+
+ (* Perform a full collection - good way to find GC/allocation bugs. *)
+ Gc.full_major ()
(* Simple test of the API.
* Copyright (C) 2003 Merjis Ltd.
- * $Id: test.ml,v 1.4 2003-10-16 08:54:56 rich Exp $
+ * $Id: test.ml,v 1.5 2003-10-16 11:03:52 rich Exp $
*)
open Printf
let () =
+ (* Perform a full collection - good way to find bugs in initialization code*)
+ Gc.full_major ();
+
(* Load "test.pl". *)
Perl.eval "require 'examples/test.pl'";
printf "TestClass.foo is %d\n" (Perl.int_of_sv sv); flush stdout;
(* Destroy the interpreter. *)
- Perl.destroy (Perl.current_interpreter ())
+ Perl.destroy (Perl.current_interpreter ());
+
+ (* Perform a full collection - good way to find GC/allocation bugs. *)
+ Gc.full_major ()
/* Interface to Perl from OCaml.
* Copyright (C) 2003 Merjis Ltd.
- * $Id: perl_c.c,v 1.6 2003-10-15 16:51:12 rich Exp $
+ * $Id: perl_c.c,v 1.7 2003-10-16 11:03:51 rich Exp $
*/
#include <stdio.h>
{
CAMLparam1 (unit);
PERL_SYS_INIT3 (NULL, NULL, NULL);
- return Val_unit;
+ CAMLreturn (Val_unit);
}
CAMLprim value
{
CAMLparam1 (unit);
if (my_perl == 0) raise_not_found ();
- return Val_perl (my_perl);
+ CAMLreturn (Val_perl (my_perl));
}
static void