   // We allocate a memory block inside our WebAssembly module using the libc malloc function
          // given by the emscripten glue code.
          let srcBuf = Module._malloc(rawJpegAsTypedArray.length * rawJpegAsTypedArray.BYTES_PER_ELEMENT);
          // We copy the typed array to the memory block
          // Important : this memory block is a part of the heap. 
          // The heap is allocated by JS code in the Emscripten glue and 
          // given as the memory to the WebAssembly instance.
   