-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proxies working on TFFI (and worker VM)
added some comments
- Loading branch information
Showing
5 changed files
with
80 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
" | ||
I'm a function argument type to be used on the declaration of proxy methods. | ||
I am needed because in ObjC every method implementation has the same structure: | ||
id (*IMP)(receiver, selector, ...) | ||
https://developer.apple.com/documentation/objectivec/objective-c_runtime/imp | ||
being the first two arguments the receiver and the selector. | ||
this is internally converted to a send of the form | ||
receiver selector: arg | ||
(a call with the arguments). | ||
To match a regular send, we need to add this arguments to the callback, but they are hidden to the user. | ||
" | ||
Class { | ||
#name : #ObjCProxyCallbackArgument, | ||
#superclass : #FFIFunctionArgument, | ||
#traits : 'TObjCLibrary', | ||
#classTraits : 'TObjCLibrary classTrait', | ||
#category : #'ObjectiveC-Proxy' | ||
} | ||
|
||
{ #category : #resolution } | ||
ObjCProxyCallbackArgument >> asOldArraySpec [ | ||
|
||
^ #() | ||
] | ||
|
||
{ #category : #initialization } | ||
ObjCProxyCallbackArgument >> initialize [ | ||
|
||
super initialize. | ||
type := ObjCTypeDeclaration newType: (FFIVoid new | ||
pointerArity: 1; | ||
yourself) | ||
] | ||
|
||
{ #category : #resolution } | ||
ObjCProxyCallbackArgument >> resolveUsing: aResolver [ | ||
"Do nothing" | ||
] | ||
|
||
{ #category : #initialization } | ||
ObjCProxyCallbackArgument >> resolvedType [ | ||
|
||
^ type resolvedType | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters