From 7e4f30cf84eb670614e5e8f1c65cf4da934d21c3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 28 Apr 2017 22:59:48 -0700 Subject: ffi: drop obsolete restrictions in type compiler. * ffi.c (ffi_type_compile): The ptr-out and ptr-in-out types can work with target types that don't have a fill function and fixed allocation. --- ffi.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ffi.c b/ffi.c index 7a667486..9bf83ffc 100644 --- a/ffi.c +++ b/ffi.c @@ -1104,20 +1104,12 @@ val ffi_type_compile(val syntax) ffi_ptr_in_in, target_type); } else if (sym == ptr_out_s) { val target_type = ffi_type_compile(cadr(syntax)); - struct txr_ffi_type *tft = ffi_type_struct(target_type); - if (tft->fill == 0 && tft->alloc == ffi_fixed_alloc) - uw_throwf(error_s, lit("~a: ~s cannot be ptr-out target"), - self, cadr(syntax), nao); return make_ffi_type_pointer(syntax, cptr_s, sizeof (mem_t *), &ffi_type_pointer, ffi_ptr_out_put, ffi_ptr_out_get, ffi_ptr_out_in, target_type); } else if (sym == ptr_in_out_s) { val target_type = ffi_type_compile(cadr(syntax)); - struct txr_ffi_type *tft = ffi_type_struct(target_type); - if (tft->fill == 0 && tft->alloc == ffi_fixed_alloc) - uw_throwf(error_s, lit("~a: ~s cannot be ptr-in-out target"), - self, cadr(syntax), nao); return make_ffi_type_pointer(syntax, cptr_s, sizeof (mem_t *), &ffi_type_pointer, ffi_ptr_in_out_put, ffi_ptr_out_get, -- cgit v1.2.3