gc.malloc actually returns void[] Bearophile's suggestion seems to work though, but it doesn't seem to improve performance for some reason... I guess I'll have to find some other way to make my prog quicker.