[gambit-list] A proper way to allocate memory in C extensions

Frederick LeMaster fred.lemaster at gmail.com
Tue Sep 30 14:16:42 EDT 2008


Is there a proper way to allocate memory for c extensions that will be
compiled under both C and C++ versions of gambit?

In the Xlib example this is used:

(define (make-XColor-box)
  ((c-lambda ()
             XColor*
             "___result_voidstar =
___EXT(___alloc_mem) (sizeof (XColor));")))

Should I do that for foreign objects/structs? What is the proper macro
to free memory allocated this way?



More information about the Gambit-list mailing list