genericjs
The JavaScript section
Function compiled into the genericjs section will be output as JavaScript.
To place functions in the genericjs section, you can:
- Tag individual functions with the
[[cheerp::genericjs]]
attribute. - Use
-target cheerp
to default to genericjs for all functions.
Restrictions
In genericjs, there are some restrictions due to the memory model.
No type punning
In genericjs, you cannot perform type punning (for example, using memcpy
or std::bit_cast
).