[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Swig and MzScheme's _scheme_get_type_name




--- Paul Fernhout <pdfernhout@kurtz-fernhout.com>
wrote:
> Scheme_Type pointrel_type = 0;

You'll gain more karma if the type is made static, so
it isn't exported from the file.  In the few
extensions I've written, I've put the type
initialisation in scheme_initialize <sp> so it's
guaranteed to only occur once.  Then, the check in
swig_make_c_pointer

> Scheme_Object *swig_make_c_pointer(void *c_pointer,
> char *type_name) {
>     swig_proxy *new_proxy;
>     new_proxy = (swig_proxy *)
> scheme_malloc(sizeof(swig_proxy));
>     if (0 == pointrel_type) pointrel_type =
> scheme_make_type(type_name);

is unnecessary

HTH

Noel


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/