Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

185
Vistas
How do I allocate memory from JS at specific locations of the wasm memory buffer?

I want to set specific values at the first N bytes of a wasm memory buffer and pass it to the wasm module. So I do something like this in my JS code:

const array = new Int32Array(memory.buffer, 0, 5)
array.set([3, 15, 18, 4, 2])

... and the guest c++ function can take a pointer to the first location and an int for the length of the array, and do something with the values.

My question is: If I want to make sure that these bytes are not overwritten by any c++ code that might run subsequently and allocate memory, is there a best practice to do so? i.e. I want to make sure that the first N bytes are only set on the JS side.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda