- Feb 03, 2022
-
-
- Jan 31, 2022
-
-
Stas Boukarev authored
Where variadic arguments are not just passed normally. Closes #297
-
- Jan 07, 2022
-
-
Stelian Ionescu authored
-
- Aug 19, 2021
-
-
stacksmith authored
It remains compatible with existing code, but accepts additional formats for bindings: 1) (name slot-name) - just like WITH-SLOTS; 2) (name :pointer slot-name) - a pointer version.
-
- May 15, 2021
-
-
jathd authored
When a foreign function is not found by find-foreign-function (either because the function doesn't exist, or because the library is not loaded), nil is returned, so %%foreign-funcall is called with nil as a function, which ultimately leads to a null-pointer exception. Better to signal an error on the lisp side.
-
- Apr 14, 2021
-
-
Attila Lendvai authored
the process is: foo.h -> foo.spec -> foo.lisp foo.spec -> foo.lisp works as expected, but foo.h -> foo.spec is only executed when the spec file is entirely missing.
-
Attila Lendvai authored
-
- Feb 27, 2021
-
-
Cyrus Harmon authored
* This is the (current) default path for arm64 homebrew libraries. Try this before the rest.
-
- Feb 01, 2021
-
-
Stuart Dilts authored
defun-like semantics were meant for defcallback, but it's no longer used there. This allows for empty structure/union definitions, e.g. (defcstruct foo "empty").
-
- Jan 21, 2021
-
-
ellisvelo authored
In Mac OS Big Sur, system dynamic libraries are no longer present on the filesystem and reside in the dynamic linker cache. This change searches for the framework directory instead of the dynamic library underneath the framework directory. https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes Fixes lp#1906982.
-
- Jan 01, 2021
-
-
Add specialized lookup for the default table case. This should be faster that the previous EQUAL hash table scheme.
-
- Dec 30, 2020
-
-
Use sb-thread::*initial-thread*
-
- Oct 15, 2020
-
-
This includes size, ssize, ptrdiff, offset, intptr, and uintptr
-
- Sep 20, 2020
-
-
Luís Oliveira authored
Use a list rather than a hash-table to keep track of types seen. Although this pessimizes the time complexity of this algorithm from O(n) to O(n^2), using an hash-table only becomes faster once we reach n=250 and using a list reduces consing by an order of magnitude. For the common case where the typedef chain is only one or two types long, using a list is also one or two orders of magnitude faster. This makes slow code paths that call PARSE-TYPE at runtime a bit less painful. Benchmark: (defun make-typedef-chain (size) (if (zerop size) :int (eval `(cffi:defctype ,(make-symbol (format nil "TYPEDEF-~a" size)) ,(make-typedef-chain (1- size)))))) (let ((chain (cffi::parse-type (make-typedef-chain 2)))) (funcall (compile nil (lambda () (time (loop repeat 100 do (cffi::check-for-typedef-cycles chain)))))))
-
- Aug 10, 2020
-
-
Luís Oliveira authored
Previously assumed the presence of the :ALIEN-CALLBACK-CONVENTIONS feature which was only ever present in the Anton Kovalenko's sbcl-win32-threads fork. Fixes lp issue #1890671 reported by Matthew Stickney.
-
- Jun 02, 2020
-
-
Mark authored
In abcl-1.7.0, CL:MAKE-ARRAY is able create and share malloc()d memory for java.nio.ByteVector allocated by JNA via use of the :NIO-BUFFER argument. Whether this feature is present in the current implementation is conditionalized on the presence :NIO in CL:*FEATURES*. We retain the old behavior of copying memory for WITH-POINTER-TO-VECTOR-DATA when passed a non-shareable byte vector as a plausible fallback strategy.
-
- May 18, 2020
-
-
Stelian Ionescu authored
* add option :CANARY to DEFINE-FOREIGN-LIBRARY: a foreign symbol unique to the library If that symbol is found in the current image before the first attempt to load the library, the latter is assumed to be statically linked and LOAD-FOREIGN-LIBRARY only marks the load state as :STATIC before returning. * add new slot LOAD-STATE which, together with HANDLE, tracks the library | library state | LOAD-STATE | HANDLE | |-------------------|------------|---------| | not loaded | NIL | NIL | | statically linked | :STATIC | NIL | | dlopen()'d | :EXTERNAL | non-NIL |
-
- May 17, 2020
-
-
Francois-Rene Rideau authored
-
- May 12, 2020
-
-
Luís Oliveira authored
This reverts commit c5d140fe.
-
- May 11, 2020
-
-
Luís Oliveira authored
-
- May 04, 2020
-
-
Shinmera authored
This is useful for very large enumerations of which we're only interested in a subset, or enumerations that allow for arbitrary client or vendor extensions that we cannot be aware of. Erroring on a value that we ostensibly do not care about in such a situation is not desirable, and instead simply passing through the integer allows handling the interesting cases easily in a CASE or something similar.
-
- Feb 26, 2020
-
-
Madhu authored
CFFI now always translates aggregate struct values to lisp property lists. Earlier struct values which were defined by types introduced by defctype were translated as foreign pointers. One consequence of this change is that defcvar to a foreign struct will always produce an immutable lisp list. To modify the struct the user first has to get at the pointer to the struct via FORIEGN-SYMBOL-VALUE or GET-VAR-POINTER. To modify nested structs the user has to get at the pointer to the field via FORIEGN-SLOT-POINTER, - or use the the (:POINTER VAR) syntax of WITH-FOREIGN-SLOTS. * src/early-types.lisp: (defctype): use translatable-foreign-type instead of enhanced-foreign-type. * tests/structs.lisp: New tests: (misnamed) STRUCT-VALUES.FSBV.1 STRUCT-VALUES.FSBV.1 Updated tests: STRUCT.ALIGNMENT.1 STRUCT.ALIGNMENT.2 STRUCT.ALIGNMENT.3 STRUCT.ALIGNMENT.4 STRUCT.ALIGNMENT.5 STRUCT.ALIGNMENT.6 STRUCT.ALIGNMENT.7 STRUCT.NESTED-SETF STRUCT.ALIGNMENT.8
-
- Jan 24, 2020
-
-
Stas Boukarev authored
-
- Jan 06, 2020
-
-
Stelian Ionescu authored
-
- Dec 19, 2019
-
-
Stelian Ionescu authored
Return the pointer if the offset is 0.
-
- Dec 08, 2019
-
-
Mark Skilbeck authored
-
- Nov 17, 2019
-
-
* this allows the ABCL varargs tests to pass
-
- Sep 15, 2019
-
-
- Mar 01, 2019
-
-
Georges Martin authored
-
- Dec 25, 2018
-
-
3 b authored
KEYWORDP can't be constant folded, since a symbol could be uninterned after compilation, so using a more general type gets rid of some style warnings on SBCL. %FOREIGN-ENUM-VALUE has an explicit check for ENUM-KEY, so that is probably more correct than KEYWORD anyway.
-
- Feb 03, 2018
-
-
Attila Lendvai authored
lib authors will need to invoke it by hand using: (cffi/c2ffi:generate-spec :your-system)
-
Attila Lendvai authored
-
- Feb 02, 2018
-
-
Attila Lendvai authored
-
Attila Lendvai authored
-
- Jan 30, 2018
-
-
Attila Lendvai authored
-
Attila Lendvai authored
-
- Jan 03, 2018
-
-
Michał Herda authored
Rename test ARRAY.ROUND-TRIP to ARRAY.FOREIGN-TO-LISP.BASIC Add test ARRAY.FOREIGN-TO-LISP.ADJUSTABLE Add test ARRAY.FOREIGN-TO-LISP.DISPLACED Add test ARRAY.FOREIGN-TO-LISP.SPECIALIZED Implementation detail for test ARRAY.FOREIGN-TO-LISP.SPECIALIZED: 15.1.2.2 of the Holy Standard states that the only truly portable array specializations are for bits (bit-vectors) and characters (strings). Since char-codes are implementation-dependent, it would be tricky to write a portable test for them without generating characters at runtime. So, for a truly portable test, we are only left with bits, which are luckily numeric, and equal to (UNSIGNED-BYTE 1). This is why this test is so terribly wasteful, spending a whole byte for a single bit - CFFI has no capabilities for dealing with single bits, and this test is only meant to check correctness of the :ELEMENT-TYPE argument to MAKE-ARRAY. In actual use cases of specialized FOREIGN-ARRAY-TO-LISP, capable implementations will be able to make specialized arrays of types that are commonly optimized for and/or representable in hardware, such as (UNSIGNED-BYTE 8) on x86 architectures. Implements lp bug #1740800.
-
- Oct 05, 2017
-
-
We refactor and provide interface cleanup, so code is more intelligible.
-
Export end extend foreign-funcall interface so we can explicitly say, that variadic function is beeing called. Interfaces already existed and was extended to support customization by the implementation (preliminary step to improve ECL support).
-
- Oct 03, 2017
-
-
Luís Oliveira authored
... and avoid catching non-simple-errors coming from %LOAD-FOREIGN-LIBRARY since those are unexpected and we're specifically set up to report SIMPLE-ERRORs. Fixes lp#1720626.
-