Merge branch 'ZackerySpytz-OCaml-classDirectorMethod-CAMLreturn'

* ZackerySpytz-OCaml-classDirectorMethod-CAMLreturn:
  [OCaml] Fix possible GC issues in generated director code

 Conflicts:
	Examples/test-suite/ocaml/director_unroll_runme.ml
This commit is contained in:
William S Fulton 2019-02-09 22:54:43 +00:00
commit 9ab873f432
2 changed files with 15 additions and 16 deletions

View file

@ -3,17 +3,13 @@ open Director_unroll
let director_unroll_MyFoo ob meth args =
match meth with
| "ping" -> C_string "director_unroll_MyFoo::ping()"
| "ping" -> C_string "MyFoo::ping()"
| _ -> (invoke ob) meth args
let a =
new_derived_object
new_Foo (director_unroll_MyFoo) '()
let a = new_derived_object
new_Foo (director_unroll_MyFoo) '()
let _ =
let b = new_Bar '() in
let _ = b -> set (a) in
let c = b -> get () in
assert (director_unroll_MyFoo c "ping" '() as string =
"director_unroll_MyFoo::ping()");
;;
let b = new_Bar '()
let _ = b -> set (a)
let c = b -> get ()
let _ = assert ((a -> "&" () as int) = (c -> "&" () as int))