[squeak-dev] FFI: FFI-Kernel-mt.93.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jun 4 17:50:57 UTC 2020


Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI:
http://source.squeak.org/FFI/FFI-Kernel-mt.93.mcz

==================== Summary ====================

Name: FFI-Kernel-mt.93
Author: mt
Time: 4 June 2020, 7:50:57.117722 pm
UUID: 7f85e15e-756b-b142-a6e9-54ecdf13e97d
Ancestors: FFI-Kernel-mt.92

Fixes a regression from the previous commit. Not all subclasses of ExternalStructure have fields to be compiled. Mark that with #isSkipped, which is coherent with ExternalPool's #isSkipped.

Mark empty structure types, which are the ones where only the pointer should be used.

Fixes a bug (or regression?) in #doneCompiling. That is,  support changing the base class from, e.g., Object to ExternalStructure.

=============== Diff against FFI-Kernel-mt.92 ===============

Item was added:
+ ----- Method: ExternalData class>>isSkipped (in category 'field definition') -----
+ isSkipped
+ 
+ 	^ true!

Item was added:
+ ----- Method: ExternalPackedStructure class>>isSkipped (in category 'field definition') -----
+ isSkipped
+ 
+ 	^ self == ExternalPackedStructure!

Item was changed:
  ----- Method: ExternalStructure class>>doneCompiling (in category 'class management') -----
  doneCompiling
+ 
+ 	"Base class changed to something that is an external structure now."
+ 	self compiledSpec ifNil: [self compileFields].!
- 	"I have been recompiled. Update any types that reference me."
- 	ExternalType noticeModificationOf: self.!

Item was changed:
  ----- Method: ExternalStructure class>>fields (in category 'field definition') -----
  fields
+ 	"Return the fields defining the receiver. By default, return an empty array, which means that only the pointer type of this external structure should be used."
+ 	
- 	"Return the fields defining the receiver"
  	^#()!

Item was added:
+ ----- Method: ExternalStructure class>>isSkipped (in category 'field definition') -----
+ isSkipped
+ 
+ 	^ self == ExternalStructure!

Item was changed:
  ----- Method: ExternalStructure class>>recompileStructures (in category 'system startup') -----
  recompileStructures
  	"Check and update the layout of all subclasses for host machine dependency.
  	Arrange to check the inner nested structures first."
  	
  	"ExternalStructure recompileStructures"
  	| sorted unsorted priorAuthorInitials |
+ 	unsorted := self withAllSubclasses reject: [:ea | ea isSkipped].
- 	unsorted := self withAllSubclasses.
  	sorted := OrderedCollection new: unsorted size.
  	self sortStructs: unsorted into: sorted.
  	priorAuthorInitials := Utilities authorInitialsPerSe.
  	Utilities setAuthorInitials: 'FFI'.
  	[sorted do: [:struct | struct checkFieldLayoutChange ifFalse: [
  			"Even if no layout change, communicate that result to the corresponding types."
  			struct externalType
  						compiledSpec: struct compiledSpec;
  						byteAlignment: struct byteAlignment]]]
  		ensure: [Utilities setAuthorInitials: priorAuthorInitials]!

Item was added:
+ ----- Method: ExternalType>>isEmptyStructureType (in category 'testing') -----
+ isEmptyStructureType
+ 	"Return true if the receiver represents a structure type"
+ 	^ self isStructureType and: [self byteSize = 0]!

Item was changed:
  ----- Method: ExternalType>>printOn: (in category 'printing') -----
  printOn: aStream
  
  	self isTypeAlias ifTrue: [
  		aStream
  			nextPutAll: referentClass name;
  			nextPut: $<;
  			print: self originalType;
  			nextPut: $>.
  		^ self].
  	
  	self isAtomic
  		ifTrue: [aStream nextPutAll: (AtomicTypeNames at: self atomicType)]
  		ifFalse: [
  			referentClass == nil
  				ifTrue:[aStream nextPutAll: '<unknown struct type>']
+ 				ifFalse:[
+ 					aStream nextPutAll: referentClass name.
+ 					self isEmptyStructureType
+ 						ifTrue: [aStream nextPutAll: ' { void }']]].
- 				ifFalse:[aStream nextPutAll: referentClass name]].
  	self isPointerType ifTrue:[aStream nextPut: $*].!

Item was added:
+ ----- Method: ExternalTypeAlias class>>isSkipped (in category 'field definition') -----
+ isSkipped
+ 
+ 	^ self == ExternalTypeAlias!

Item was added:
+ ----- Method: ExternalUnion class>>isSkipped (in category 'field definition') -----
+ isSkipped
+ 
+ 	^ self == ExternalUnion!



More information about the Squeak-dev mailing list