Difference between revisions of "WebAssembly/Globals"

From Free Pascal wiki
Jump to navigationJump to search
Line 2: Line 2:
  
 
== Differences between Pascal global variables and WebAssembly globals ==
 
== Differences between Pascal global variables and WebAssembly globals ==
 +
 +
WebAssembly globals have the following restrictions:
 +
* they can be only one of 4 types - 32-bit int, 64-bit int, single (float32) or double (float64)
 +
* their address cannot be taken
 +
* in a multithreaded environment, they are usually not shared between threads, i.e. they behave like threadvars
  
 
[[Category:WebAssembly]]
 
[[Category:WebAssembly]]

Revision as of 14:18, 22 July 2022

WebAssembly supports a feature, called "global variables" or just "globals". They differ from global variables in Pascal. This page discusses the possibility of extending FPC, in order to be able to declare WebAssembly globals from Pascal code.

Differences between Pascal global variables and WebAssembly globals

WebAssembly globals have the following restrictions:

* they can be only one of 4 types - 32-bit int, 64-bit int, single (float32) or double (float64)
* their address cannot be taken
* in a multithreaded environment, they are usually not shared between threads, i.e. they behave like threadvars