6 Linear Memory
In this chapter, we’ll examine what linear memory is, how to use it to share data between JavaScript and WebAssembly code, and how to create it from within JavaScript. We’ll also update linear memory from WebAssembly and then use those updates from within the JavaScript code.
One common task in computer games is collision detection, detecting and appropriately reacting to two objects touching. The number of computations required grows exponentially as you add objects. Collision detection is a great candidate for building in WebAssembly. In this chapter, we’ll create a list of circles defined randomly in the JavaScript, and ...
Get The Art of WebAssembly now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.