Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
Pass pointer of an object built in javascript land to webassembly (C++) function

I have a function in C++ that takes a (const char*) argument. I want to call this function in JavaScript (through Web assembly) by passing to it the address of an object created in JavaScript. Is this possible?

The code is something like

// Create an object by loading from url.
const encoder = await loadModel("some_url");
const data = [1,2,3];

Module.onRuntimeInitialized = _ => {
  // Call the wasm function with a pointer to the encoder.
  Module.encode(&encoder, data);
}

How can I take the address of the encoder object to pass to the function?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It is common to serialize the JavaScript object to a primitive string to pass between programming languages.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!