Compare commits

...

2 Commits

Author SHA1 Message Date
ca94e59b53 MV_INLINE: more better limitations expressed 2025-10-13 01:41:44 -06:00
1adfca2a9f typos 2025-10-12 03:24:32 -06:00
2 changed files with 18 additions and 1 deletions

View File

@@ -16,6 +16,23 @@ Some limitations apply:
- The passed function cannot tailcall or otherwise recursively call itself.
- You must use this macro in it's specific form, i.e. `local <var> = MV_INLINE(function() ... end)`
Note that this pass acts more like a preprocessor that replaces the function calls with the results of the function (if any), and can have strange effects in some cases.
For example, when an inlined function is called, its function body is inserted right before the statement the call is in. This can lead to some unexpected behavior when used in `or` or `if` expressions:
```lua
local called = false
local testFunc = MV_INLINE(function()
called = true
return 'hi'
end)
local foo = 'bar' or testFunc()
print(foo, called)
```
Will print `bar true`, where under normal circumstances testFunc should not be executed. This is because the `or` expression is evaluated after the inserted body.
## Valid Usage
```lua

View File

@@ -9,7 +9,7 @@ lastmod: "2025-05-01T18:47:58-05:00"
MoonVeil provides multiple solutions to improve and optimize the performance of your scripts.
## Using the 'Fast VM' option
## Using the 'Fast VM' preset
This preset is available in [your dashboard's settings](/docs/dashboard/). If you're still having performance issues, continue reading.