VM Maker: VMMaker.oscog-eem.2823.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-eem.2823.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2823.mcz

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

Name: VMMaker.oscog-eem.2823
Author: eem
Time: 25 September 2020, 2:27:55.406854 pm
UUID: c3499cc6-9d5a-4f10-a63e-1420d71368e5
Ancestors: VMMaker.oscog-eem.2822

SocketPlugin: propitiate the Slang demons.  Functions which fail cannot be passed as arguments, but must be assigned to variables.

=============== Diff against VMMaker.oscog-eem.2822 ===============

Item was changed:
  ----- Method: SocketPlugin>>primitiveSocket:sendUDPData:toHost:port:start:count: (in category 'primitives') -----
  primitiveSocket: socket sendUDPData: array toHost: hostAddress  port: portNumber start: startIndex count: count
+ | s elementSize arrayBase bytesSent hostAddressInteger |
- | s elementSize arrayBase bytesSent |
  <var: #s type: #SocketPtr>
  self primitive: 'primitiveSocketSendUDPDataBufCount'
  parameters: #(Oop Oop ByteArray SmallInteger SmallInteger SmallInteger).
 
  "buffer can be any indexable bits object"
  elementSize := self cppIf: SPURVM
  ifTrue: [interpreterProxy bytesPerElement: array]
  ifFalse: [(interpreterProxy isWords: array) ifTrue: [4] ifFalse: [1]].
  ((interpreterProxy isWordsOrBytes: array)
  and: [elementSize > 0
  and: [startIndex >= 1
  and: [count >= 0
  and: [startIndex + count - 1 <= (interpreterProxy slotSizeOf: array)]]]]) ifFalse:
  [^interpreterProxy primitiveFailFor: PrimErrBadArgument].
 
  s := self socketValueOf: socket.
+ hostAddressInteger := self netAddressToInt: (self cCoerce: hostAddress to: #'unsigned char *').
  interpreterProxy failed ifFalse:
  ["Note: adjust bufStart for zero-origin indexing"
  arrayBase := self cCoerce: (interpreterProxy firstIndexableField: array) to: #'char *'.
  bytesSent := self
  sqSocket: s
+ toHost: hostAddressInteger
- toHost: (self netAddressToInt: (self cCoerce: hostAddress to: #'unsigned char *'))
  port: portNumber
  SendDataBuf: arrayBase + (startIndex - 1 * elementSize)
  Count: count * elementSize].
  ^(bytesSent // elementSize) asSmallIntegerObj!