Go ProSign in

This Lesson is for Members

Subscribe today and get access to all lessons! Plus direct HD download for offline use, enhances transcripts, member comment forums, and iTunes "podcast" RSS feed. Level up your skills now!

Unlock This Lesson

Already subscribed? Sign In

Hide playlist

    Allocate Dynamic Memory in WebAssembly with Malloc

    Guy BedfordGuy Bedford

    We demonstrate how to build a WebAssembly module that depends on malloc, linking in a pre-built malloc implementation at runtime, using a JS binding trick to handle the circular reference between the two WebAssembly modules. We then optimize the load process to ensure we are fetching these modules in parallel.

    Malloc implementation: https://github.com/guybedford/wasm-stdlib-hack/blob/master/dist/memory.wasm

    WASM Fiddle: https://wasdk.github.io/WasmFiddle/?1feerp

    Demo Repo: https://github.com/guybedford/wasm-intro

    You must be a Member to view code