Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

181
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda