<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
<img id="f85b446c-ae65-432c-aa16-76d411eaa813" src="cid:f8924c0a-f122-47c5-be81-1de4749377c6" width="305" height="250"></img><br><div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 06.05.2021 19:57:59 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style="font-family:Arial,Helvetica,sans-serif">Marcel Taeumel uploaded a new version of FFI-Tools to project FFI:<br>http://source.squeak.org/FFI/FFI-Tools-mt.28.mcz<br><br>==================== Summary ====================<br><br>Name: FFI-Tools-mt.28<br>Author: mt<br>Time: 6 May 2021, 7:57:49.985981 pm<br>UUID: baed18b3-7684-634c-b285-691d551be27c<br>Ancestors: FFI-Tools-mt.27<br><br>Make the label for handles accessed via byte-array read-writer more readable by summarizing skipped bytes to a number instead of dots after a certain threshold, which is 16 bytes at the moment.<br><br>=============== Diff against FFI-Tools-mt.27 ===============<br><br>Item was changed:<br> ----- Method: ExternalObjectHandleWrapper>>objectString (in category 'accessing') -----<br> objectString<br> <br>+ | label handle skipLimit |<br>- | label handle |<br> label := super objectString.<br> handle := self getHandle.<br>+ skipLimit := 16.<br> <br> handle isExternalAddress ifTrue: [^ label].<br> handle isInternalMemory ifTrue: [<br> ^ (thisContext objectClass: handle) == ByteArrayReadWriter<br> ifFalse: [label]<br>+ ifTrue: [ | begin end tokens |<br>+ label :=(thisContext object: handle instVarAt: 3) "byteArray" printString.<br>- ifTrue: [ | begin end |<br>- label :=(thisContext object: handle instVarAt: 3) printString.<br> label := label copyFrom: 3 to: (label size - 1).<br>+ begin := (thisContext object: handle instVarAt: 1) "byteOffset" + 1.<br>+ end := begin - 1 + (thisContext object: handle instVarAt: 2) "byteSize".<br>- begin := (thisContext object: handle instVarAt: 1) + 1.<br>- end := begin + (thisContext object: handle instVarAt: 2) - 1.<br> String streamContents: [:stream |<br> stream nextPutAll: '#[ '.<br>+ tokens := label findTokens: ' ' "#[0 0 0 0 0]".<br>+ begin > skipLimit ifTrue: [<br>+ stream nextPutAll: '. . ', (begin - 1) asString, ' bytes . . '.<br>+ tokens := tokens allButFirst: begin - 1.<br>+ end := end - begin + 1. begin := 1].<br>+ (1 to: end) do: [:index | | token |<br>+ token := tokens at: index.<br>+ index >= begin<br>- (label findTokens: ' ' "#[0 0 0 0 0]") withIndexDo: [:token :index |<br>- (index between: begin and: end)<br> ifTrue: [stream nextPutAll: token]<br> ifFalse: ["Skip byte info" stream nextPut: $.].<br> stream space].<br>+ (tokens size - end + 1) > skipLimit ifTrue: [<br>+ stream nextPutAll: '. . ', (tokens size - end) asString, ' bytes . . '.<br>+ tokens := tokens allButLast: tokens size - end.<br>+ end := tokens size].<br>+ (tokens size - end) timesRepeat: [<br>+ "Skip byte info" stream nextPut: $..<br>+ stream space].<br> stream nextPutAll: ']'.<br> ]]].<br> <br> "Type aliases to atomic types store primitive Smalltalk objects in their handle. Indicate that role of actually being a handle for the FFI plugin with a small prefix."<br> ^ '-> ', label!<br><br><br></div></blockquote></div>