Thanks,
Andy
--
Andrew I. Schein
web: www.andrewschein.com
> I have been looking at the Bigarray code to figure out how it
> works. I see in the bigarray_get_N function inside
> bigarray_stubs.c, that there is no use of macro CAMLParam* or
> CAMLReturn. How is it that these macros are unnecessary in this code?
These macros allow the garbage collector find and update pointers on
the stack. Without them, the GC might collect the referenced objects,
leaving dangling pointers in stack-local variables. The use of these
macros is unnecessary overhead if (1) the collector cannot be invoked
from the function (that is, no GC memory is allocated from it) or (2)
there are no object references kept in parameters or local variables.
— Gordon
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs