WebAssembly image dithering example

Radu void at null.pt
Fri Aug 3 12:21:21 UTC 2018


On Friday, 3 August 2018 at 12:01:10 UTC, Kagamin wrote:
> On Friday, 3 August 2018 at 11:42:18 UTC, Radu wrote:
>> It wasn't a question :) it was an example, the way I did mine 
>> - you pass the length to the Js side, no need to mess with 
>> statics.
>
> With your approach the callee must know what will be done with 
> the return value, it's more handy to just have a string and 
> then the caller decides what to do with it.

Yes, but in that case I think there are better solutions, like 
returning a `long` that masks ptr and size, you have plenty of 
room given that ptr is an offset from a predefined chunk o linear 
memory (thus a small value) and you are also limited in size.

Js will map that to Number from which you can use 56 bits for 
that ptr+size pair.




More information about the digitalmars-d-ldc mailing list