[fpc-devel] c-blocks (darwin aarch64)
Jonas Maebe
jonas.maebe at elis.ugent.be
Sat Apr 16 21:05:43 CEST 2016
Dmitry Boyarintsev wrote:
> On Fri, Apr 15, 2016 at 9:09 PM, Dmitry Boyarintsev
> <skalogryz.lists at gmail.com <mailto:skalogryz.lists at gmail.com>> wrote:
>
> I'm going to update to the latest FPC revision now.
>
> Using r33526, the app crashes with compiler native blocks at the same
> spot (on calling set block handler)
Can you share code that crashes?
> Two differences I can see between "manual" block and compiler block.
>
> 1) set of flags. Manual block doesn't set any of them (in the original
> example, and GLOBAL flag is set in the example below), where the
> compiler always sets up BLOCK_HAS_SIGNATURE .
Yes, because it's required if you use the "ABI.2010.3.16", which FPC
does (because otherwise the block functions are called as C-style
varargs functions, which we cannot handle on the callee side).
> 2) the compiler is using Simple description, where manual is using
> complex. I'm looking Blocks ABI
> (http://clang.llvm.org/docs/Block-ABI-Apple.html#imported-variables),
>
> I don't see any reference if "copy" and "dispose" fields could omit and
> it's allowed to "signature" follow "size" field right away. (I'd think
> they would use "union" in this case to declare "description")
See http://clang.llvm.org/docs/Block-ABI-Apple.html#high-level
Those fields only exist if bits 25 resp. 26 are set in the flags.
> Also, as far as I understand signature is used for functions returning
> structures (records)?
The signature field is required as soon as you say you comply to the
"ABI.2010.3.16".
Jonas
More information about the fpc-devel
mailing list