Difference between revisions of "Allocated"
From Mesham
Jump to navigationJump to search (Created page with '== Syntax == allocated[{type}] == Semantics == This type sets the memory allocation of a variable, which may not be modified once set. == Example == var i: Int :: allocated…') |
m (5 revisions imported) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Syntax == | == Syntax == | ||
− | allocated[ | + | allocated[type] |
+ | |||
+ | Where ''type'' is optional | ||
== Semantics == | == Semantics == | ||
Line 9: | Line 11: | ||
== Example == | == Example == | ||
− | var i: Int :: allocated[]; | + | function void main() { |
+ | var i: Int :: allocated[]; | ||
+ | }; | ||
In this example the variable ''i'' is an integer. Although the ''allocated'' type is provided, no addition information is given and as such Mesham allocates it to each processor. | In this example the variable ''i'' is an integer. Although the ''allocated'' type is provided, no addition information is given and as such Mesham allocates it to each processor. | ||
+ | |||
+ | ''Since: Version 0.41b'' | ||
[[Category:Type Library]] | [[Category:Type Library]] | ||
− | [[Category: | + | [[Category:Compound Types]] |
[[Category:Allocation Types]] | [[Category:Allocation Types]] |
Latest revision as of 15:44, 15 April 2019
Syntax
allocated[type]
Where type is optional
Semantics
This type sets the memory allocation of a variable, which may not be modified once set.
Example
function void main() { var i: Int :: allocated[]; };
In this example the variable i is an integer. Although the allocated type is provided, no addition information is given and as such Mesham allocates it to each processor.
Since: Version 0.41b