Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI:
http://source.squeak.org/FFI/FFI-Kernel-mt.207.mcz
==================== Summary ====================
Name: FFI-Kernel-mt.207
Author: mt
Time: 17 August 2021, 12:08:20.929505 pm
UUID: 693d99be-bab4-8d4c-801c-96a534e6f7d0
Ancestors: FFI-Kernel-mt.206
Adds version number of FFI plugin to the platform description. Needs primitivePluginVersion but defaults to 1 since this is a new concept. I will add this to the plugin shortly.
Note that the plugin version can be used to coordinate the communication the relies on shared data structures such as atomic-type codes and classes in the special-objects array. Then, older FFI plugins can keep on working with newer FFI images. This makes it easier to develop plugin and image-code concurrently but not in parallel. :-) Note that we do not have an "Update this VM" button in the image but we can easily update image code. Additional warnings can then help users to be notified when more recent VMs/plugins might be available.
Note that this does not help with older image code running on newer plugins. So, update your image first, then update the VM/plugins.
Note that I used the name #pluginVersion from the SqueakSSL plugin, which already provides that information.
=============== Diff against FFI-Kernel-mt.206 ===============
Item was changed:
Object subclass: #FFIPlatformDescription
+ instanceVariableNames: 'name osVersion subtype wordSize endianness pluginVersion'
- instanceVariableNames: 'name osVersion subtype wordSize endianness'
classVariableNames: 'CheckFFIOnStartUp LastPlatform'
poolDictionaries: ''
category: 'FFI-Kernel-Support'!
!FFIPlatformDescription commentStamp: 'mt 6/2/2020 15:18' prior: 0!
This class stores the information about the current (host) platform. It supports testing instances for platform compatibility and specificity. The entire FFI machinery should go through here, when making platform-specific decisions such as when figuring out the #wordSize for pointers to external memory (i.e., ExternalAddress class >> #new) or when looking up compatible definitions for external pools (i.e., ExternalPool class >> #compatibleResolvedDefinitions).
1. DETECT PLATFORM CHANGE ON STARTUP
This class is registered for system startup. It then checks whether the current platform is different from the last one. In that case, a selection of FFI classes gets notified such as ExternalObject and ExternalType.
2. PLATFORM SPECIFICITY
Platform descriptions may be unspecific, that is, some of their values may be undefined. For example, (FFIPlatformDescription name: 'unix') creates a valid description but is not specific about #osVersion or #wordSize. When comparing such descriptions, precedence of the platform values are:
platform name > osVersion > subtype > wordSize
So, if one description has a #name and the other does not, the first one is more specific. If both have #name but only the second one has #osVersion, the second one is more specific. If one has only #wordSize and another one has only #subtype, the second one is more specific because #subtype has a higher precedence than #wordSize.
3. PLATFORM COMPATIBILITY
Platform descriptions implement a notion of compatibility, which is coupled to its notion of specificity as mentioned before. Using the same rules of precedence, compatibility is checked by comparing the description's values. If not specificed, compatibility is assumed. If specified, values must match via #= to be regarded compatible.
Here is an interesting edge case of two compatible platform descriptions:
| p1 p2 |
p1 := FFIPlatformDescription name: 'Win32' osVersion: '' subtype: 'IX86' wordSize: nil.
p2 := FFIPlatformDescription name: '' osVersion: 'linux-gnu' subtype: '' wordSize: 8.
p1 isCompatibleWith: p2.
Consequently, the developer has to be careful with unspecific platform descriptions, which are used, for example, in the definitions of external pools.
4. FURTHER READING
- all references to FFIPlatformDescription
- all senders of #wordSize
- class comments of ExternalAddress, ExternalType, ExternalPool, ExternalObject
!
Item was added:
+ ----- Method: FFIPlatformDescription class>>currentPluginVersion (in category 'system startup') -----
+ currentPluginVersion
+ "Answers the version of the currently loaded FFI plugin. Can be used to coordinate the communication that relies on shared data structures such as type codes (e.g., v1 means float = 12 and double = 13) and classes (e.g., v1 means ExternalType has compiledSpec at instVar[1] and ExternalObject has handle at instVar[1]."
+ <primitive: #primitivePluginVersion module: #SqueakFFIPrims>
+ ^ 1!
Item was added:
+ ----- Method: FFIPlatformDescription class>>name:osVersion:subtype:wordSize:pluginVersion: (in category 'instance creation') -----
+ name: aName osVersion: anOSVersionString subtype: aSubtypeString wordSize: aWordSize pluginVersion: aVersionNumber
+ ^ self new
+ name: aName;
+ osVersion: anOSVersionString;
+ subtype: aSubtypeString;
+ wordSize: aWordSize;
+ pluginVersion: aVersionNumber!
Item was changed:
----- Method: FFIPlatformDescription class>>newCurrent (in category 'instance creation') -----
newCurrent
^ self
name: self currentName
osVersion: self currentOSVersion
subtype: self currentSubtype
+ wordSize: self currentWordSize
+ pluginVersion: self currentPluginVersion!
- wordSize: self currentWordSize!
Item was changed:
----- Method: FFIPlatformDescription>>= (in category 'comparing') -----
= anObject
self == anObject
ifTrue: [^ true].
self species == anObject species
ifFalse: [^ false].
^ self name = anObject name
and: [self osVersion = anObject osVersion
+ and: [self subtype = anObject subtype
+ and: [self wordSize = anObject wordSize
+ and: [self pluginVersion = anObject pluginVersion]]]]!
- and: [self subtype = anObject subtype
- and: [self wordSize = anObject wordSize]]].!
Item was added:
+ ----- Method: FFIPlatformDescription>>pluginVersion (in category 'accessing') -----
+ pluginVersion
+ ^ pluginVersion ifNil: [pluginVersion := 1]!
Item was added:
+ ----- Method: FFIPlatformDescription>>pluginVersion: (in category 'accessing') -----
+ pluginVersion: anInteger
+ pluginVersion := anInteger!
Eliot Miranda uploaded a new version of FFI-Kernel to project FFI:
http://source.squeak.org/FFI/FFI-Kernel-eem.204.mcz
==================== Summary ====================
Name: FFI-Kernel-eem.204
Author: eem
Time: 13 August 2021, 8:31:51.330962 pm
UUID: 09eff658-357f-4556-b74d-d328b259b8e1
Ancestors: FFI-Kernel-mt.203
3 times faster ExternalAddress class>>fromInteger:
=============== Diff against FFI-Kernel-mt.203 ===============
Item was changed:
----- Method: ExternalAddress class>>fromInteger: (in category 'instance creation') -----
fromInteger: anInteger
+ "Interpret the given integer as an address pointing to an external memory area.
+ Answer an ExternalAddress to that address."
+ <primitive: #primitiveExternalAddressFromInteger module: #SqueakFFIPrims>
- "Read the given interger as an address pointing to an external memory area."
-
| bytes |
bytes := ByteArray basicNew: self wordSize.
bytes integerAt: 1 put: anInteger size: bytes size signed: false.
^ bytes changeClassTo: self!
Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI:
http://source.squeak.org/FFI/FFI-Kernel-mt.203.mcz
==================== Summary ====================
Name: FFI-Kernel-mt.203
Author: mt
Time: 13 August 2021, 1:19:00.926799 pm
UUID: 15800863-014f-ea44-bd88-5b0ebb465a50
Ancestors: FFI-Kernel-mt.202
For backwards compatibility in terms of performance, add the integer primitives to the old-style ByteArray interface.
=============== Diff against FFI-Kernel-mt.202 ===============
Item was changed:
----- Method: ByteArray>>signedLongAt: (in category '*FFI-Kernel-examples') -----
signedLongAt: byteOffset
"For documentation and convenient exploration only. Type-safe access to byte arrays or external addresses SHOULD happen via external objects that have a type set such as instances of ExternalStructure and ExternalData."
+ <primitive: #primitiveSignedInt32At module: #SqueakFFIPrims error: ec>
-
^ ExternalType int32_t handle: self at: byteOffset!
Item was changed:
----- Method: ByteArray>>signedLongAt:put: (in category '*FFI-Kernel-examples') -----
signedLongAt: byteOffset put: value
"For documentation and convenient exploration only. Type-safe access to byte arrays or external addresses SHOULD happen via external objects that have a type set such as instances of ExternalStructure and ExternalData."
+ <primitive: #primitiveSignedInt32AtPut module: #SqueakFFIPrims error: ec>
-
^ ExternalType int32_t handle: self at: byteOffset put: value!
Item was changed:
----- Method: ByteArray>>signedLongLongAt: (in category '*FFI-Kernel-examples') -----
signedLongLongAt: byteOffset
"For documentation and convenient exploration only. Type-safe access to byte arrays or external addresses SHOULD happen via external objects that have a type set such as instances of ExternalStructure and ExternalData."
+ <primitive: #primitiveSignedInt64At module: #SqueakFFIPrims error: ec>
-
^ ExternalType int64_t handle: self at: byteOffset!
Item was changed:
----- Method: ByteArray>>signedLongLongAt:put: (in category '*FFI-Kernel-examples') -----
signedLongLongAt: byteOffset put: value
"For documentation and convenient exploration only. Type-safe access to byte arrays or external addresses SHOULD happen via external objects that have a type set such as instances of ExternalStructure and ExternalData."
+ <primitive: #primitiveSignedInt64AtPut module: #SqueakFFIPrims error: ec>
-
^ ExternalType int64_t handle: self at: byteOffset put: value!
Item was changed:
----- Method: ByteArray>>signedShortAt: (in category '*FFI-Kernel-examples') -----
signedShortAt: byteOffset
"For documentation and convenient exploration only. Type-safe access to byte arrays or external addresses SHOULD happen via external objects that have a type set such as instances of ExternalStructure and ExternalData."
+ <primitive: #primitiveSignedInt16At module: #SqueakFFIPrims error: ec>
-
^ ExternalType int16_t handle: self at: byteOffset!
Item was changed:
----- Method: ByteArray>>signedShortAt:put: (in category '*FFI-Kernel-examples') -----
signedShortAt: byteOffset put: value
"For documentation and convenient exploration only. Type-safe access to byte arrays or external addresses SHOULD happen via external objects that have a type set such as instances of ExternalStructure and ExternalData."
+ <primitive: #primitiveSignedInt16AtPut module: #SqueakFFIPrims error: ec>
-
^ ExternalType int16_t handle: self at: byteOffset put: value!
Item was changed:
----- Method: ByteArray>>unsignedLongAt: (in category '*FFI-Kernel-examples') -----
unsignedLongAt: byteOffset
"For documentation and convenient exploration only. Type-safe access to byte arrays or external addresses SHOULD happen via external objects that have a type set such as instances of ExternalStructure and ExternalData."
+ <primitive: #primitiveUnsignedInt32At module: #SqueakFFIPrims error: ec>
-
^ ExternalType uint32_t handle: self at: byteOffset!
Item was changed:
----- Method: ByteArray>>unsignedLongAt:put: (in category '*FFI-Kernel-examples') -----
unsignedLongAt: byteOffset put: value
"For documentation and convenient exploration only. Type-safe access to byte arrays or external addresses SHOULD happen via external objects that have a type set such as instances of ExternalStructure and ExternalData."
+ <primitive: #primitiveUnsignedInt32AtPut module: #SqueakFFIPrims error: ec>
-
^ ExternalType uint32_t handle: self at: byteOffset put: value!
Item was changed:
----- Method: ByteArray>>unsignedLongLongAt: (in category '*FFI-Kernel-examples') -----
unsignedLongLongAt: byteOffset
"For documentation and convenient exploration only. Type-safe access to byte arrays or external addresses SHOULD happen via external objects that have a type set such as instances of ExternalStructure and ExternalData."
+ <primitive: #primitiveUnsignedInt64At module: #SqueakFFIPrims error: ec>
-
^ ExternalType uint64_t handle: self at: byteOffset!
Item was changed:
----- Method: ByteArray>>unsignedLongLongAt:put: (in category '*FFI-Kernel-examples') -----
unsignedLongLongAt: byteOffset put: value
"For documentation and convenient exploration only. Type-safe access to byte arrays or external addresses SHOULD happen via external objects that have a type set such as instances of ExternalStructure and ExternalData."
+ <primitive: #primitiveUnsignedInt64AtPut module: #SqueakFFIPrims error: ec>
-
^ ExternalType uint64_t handle: self at: byteOffset put: value!
Item was changed:
----- Method: ByteArray>>unsignedShortAt: (in category '*FFI-Kernel-examples') -----
unsignedShortAt: byteOffset
"For documentation and convenient exploration only. Type-safe access to byte arrays or external addresses SHOULD happen via external objects that have a type set such as instances of ExternalStructure and ExternalData."
+ <primitive: #primitiveUnsignedInt16At module: #SqueakFFIPrims error: ec>
-
^ ExternalType uint16_t handle: self at: byteOffset!
Item was changed:
----- Method: ByteArray>>unsignedShortAt:put: (in category '*FFI-Kernel-examples') -----
unsignedShortAt: byteOffset put: value
"For documentation and convenient exploration only. Type-safe access to byte arrays or external addresses SHOULD happen via external objects that have a type set such as instances of ExternalStructure and ExternalData."
+ <primitive: #primitiveUnsignedInt16AtPut module: #SqueakFFIPrims error: ec>
-
^ ExternalType uint16_t handle: self at: byteOffset put: value!
Marcel Taeumel uploaded a new version of Regex-Core to project The Trunk:
http://source.squeak.org/trunk/Regex-Core-tobe.60.mcz
==================== Summary ====================
Name: Regex-Core-tobe.60
Author: tobe
Time: 12 August 2021, 11:27:45.831532 am
UUID: 80ec8d3d-9a84-4928-be0e-1b65787f895b
Ancestors: Regex-Core-ct.59
When an escaped character appeared in a charset, we did not handle adjacent ranges correctly
See RxParserTest>>testCharacterSetWithEscapedAndRange for examples.
=============== Diff against Regex-Core-ct.59 ===============
Item was changed:
----- Method: RxCharSetParser>>parseEscapeChar (in category 'parsing') -----
parseEscapeChar
+ | first |
self match: $\.
+ first := (RxsPredicate forEscapedLetter: lookahead)
+ ifNil: [ RxsCharacter with: lookahead ].
+ self next == $- ifFalse: [^ elements add: first].
+ self next ifNil: [
+ elements add: first.
+ ^ self addChar: $-].
+ self addRangeFrom: first character to: lookahead.
- elements add: ((RxsPredicate forEscapedLetter: lookahead)
- ifNil: [ RxsCharacter with: lookahead ]).
self next!