cffi-devel  

Re: [cffi-devel] %mem-{set,ref} can be inlined?

Luís Oliveira
Sun, 25 Apr 2010 07:29:45 -0700

On Sun, Apr 25, 2010 at 1:55 PM, Juan Jose Garcia-Ripoll
<juanjose.garciarip...@googlemail.com> wrote:
> I had a look at the definitions of these two functions. Right now in
> cffi-ecl.lisp it seems that they are only called with basic types, for they
> call cffi-type->ecl-type which only deals with things like integers,
> doubles, etc.
>
> Could I just produce a compiler macro that relies on this? The result would
> be much much simpler than this as it could be inlined and make use of ECL's
> embedded C statements.

Yes, you can rely that. The CFFI-SYS layer will only ever handle with
those basic types. They are defined in src/types.lisp via
DEFINE-BUILT-IN-FOREIGN-TYPE.


> Actually it would be nice if instead of a compiler macro I could define them
> to be just plain macros. Anything that prevents it?

It might work for this particular case, but I'd prefer compiler
macros. See DEFINE-MEM-ACCESSORS in cffi-sbcl.lisp for an example.

-- 
Luís Oliveira
http://r42.eu/~luis/

_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel