Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI: http://source.squeak.org/FFI/FFI-Kernel-mt.124.mcz
==================== Summary ====================
Name: FFI-Kernel-mt.124 Author: mt Time: 1 May 2021, 6:29:01.295408 pm UUID: 7c619637-8c9f-5648-b752-5043a9a455c9 Ancestors: FFI-Kernel-mt.123
Removes deprecated collection interface from ExternalData.
Nukes unused instVar 'fieldTypes' in structure types. I could not remember what I planned to do with it. Could not find it on squeak-dev either.
Extends print-string for external types with byteSize and byteAlignment. It does not look too noisy. I hope it will help remind programmers about the bytes they are working with. Well, if it becomes too noisy, we could make it a preference.
=============== Diff against FFI-Kernel-mt.123 ===============
Item was removed: - ----- Method: ExternalData>>collectWithIndex: (in category 'enumerating') ----- - collectWithIndex: elementAndIndexBlock - "See SequenceableCollection >> #collectWithIndex:." - - ^ self collectWithIndex: elementAndIndexBlock!
Item was removed: - ----- Method: ExternalData>>doWithIndex: (in category 'enumerating') ----- - doWithIndex: elementAndIndexBlock - "See SequenceableCollection >> #doWithIndex:." - - self withIndexDo: elementAndIndexBlock.!
Item was changed: ExternalType subclass: #ExternalStructureType + instanceVariableNames: '' - instanceVariableNames: 'fieldTypes' classVariableNames: '' poolDictionaries: '' category: 'FFI-Kernel'!
!ExternalStructureType commentStamp: 'mt 6/18/2020 08:54' prior: 0! I am specializing types for external structures. While compiledSpec and referentClass are still paramount when the FFI plugin is processing FFI calls, this specialization can help untangle in-image processing of external structures and their data.
In terms of plugin compatibility, you could still use instances of ExternalType as, for example, argument types in ExternalFunction -- given that compiledSpec and referentClass are correct. Argument coercing in FFI calls would still work. However, you could no longer use in-image facilities such as #readFieldAt: / #writeFieldAt:width, which is used for generating struct-field accessors. And the dynamic access through #handle:at: / #handle:at:put: would fail. Also, #printOn: would not be very helpful anymore.
So, having this specialization of ExternalType for ExternalStructure helps packaging code. :-) Of course, this type can also be used for ExternalUnion, ExternalPackagedStructure, and ExternalTypeAlias.!
Item was changed: ----- Method: ExternalStructureType>>printOn: (in category 'printing') ----- printOn: aStream
self isTypeAlias ifTrue: [ aStream nextPutAll: referentClass name. aStream nextPutAll: '~>'; print: self originalType. self isEmpty ifTrue: [aStream nextPutAll: ' ???']. ^ self]. referentClass == nil ifTrue:[aStream nextPutAll: '<unknown struct type>'] ifFalse:[ + super printOn: aStream. - aStream nextPutAll: referentClass name. self isEmpty ifTrue: [aStream nextPutAll: ' { void }']].!
Item was changed: ----- Method: ExternalType>>printOn: (in category 'printing') ----- printOn: aStream
aStream nextPutAll: (referentClass ifNil: [self atomicTypeName] ifNotNil: [referentClass name]). + self isPointerType ifTrue: [aStream nextPut: $*]. + + aStream + space; + nextPut: $(; + nextPutAll: self byteSize asString; + space; + nextPutAll: self byteAlignment asString; + nextPut: $).! - self isPointerType ifTrue: [aStream nextPut: $*].!
squeak-dev@lists.squeakfoundation.org