WebAssembly + Custom Runtime + Associative Arrays

Ferhat Kurtulmuş aferust at gmail.com
Tue Nov 10 21:23:07 UTC 2020

On Tuesday, 10 November 2020 at 18:24:03 UTC, Remi wrote:
> Hi all,
> I've been trying to compile a game project to WebAssembly for a 
> while. It had been going quite well but I'm hitting an issue 
> with associative arrays now and I don't know if it's a compiler 
> bug or something on my side.
> I uploaded some code with a broken example here: 
> https://github.com/speps/dwasmaa
> If you clone it then run a HTTP server and navigate to 
> index.htm, it will output the wrong message as described in the 
> If you compile+run it with `dub --arch=x86` it displays the 
> correct message (sorry that arch only works in Windows for now 
> as I'm not using the runtime and only hooked up Win32 API 
> console output).
> Anyway, where am I going wrong? Thanks.
> - Remi Gillig.

It is weird, but if you pass pointer aa as ref it works.

extern (C) void* _aaGetY(ref AA* aa, const 
TypeInfo_AssociativeArray aati, in size_t valuesize, in void* 

More information about the digitalmars-d-ldc mailing list