ALEOS AF API Reference Guide
- Apr 5, 2012
- Author: Sierra Wireless
This provides detailed API documentation of all the Lua modules in ALEOS AF.
Code loading/unloading utils
Type
Type
Compiles a buffer (ie a list of strings) into an executable function.
As opposed to loadstring it does not require allocating a single string for the whole source, thereby saving on memory load. Moreover, if the last argument is true, the buffer is emptied as it is read, thus saving even more memory (but destroying the buffer).
Unloads a module by removing references to it.
Type utils.loader
| utils.loader.loadBuffer(buffer, name, destroy) | Compiles a buffer (ie a list of strings) into an executable function. |
| utils.loader.unload(name) | Unloads a module by removing references to it. |
Type utils.loader
Field(s)
utils.loader.loadBuffer(buffer, name, destroy)
Compiles a buffer (ie a list of strings) into an executable function.
As opposed to loadstring it does not require allocating a single string for the whole source, thereby saving on memory load. Moreover, if the last argument is true, the buffer is emptied as it is read, thus saving even more memory (but destroying the buffer).
Parameters
-
buffer: a list of strings. -
name: is an optional chunk name used for debug traces. -
destroy: is a boolean. When true, the buffer is read destructively (saves RAM when handling big sources).
Return value
function resulting of the buffer compilation
utils.loader.unload(name)
Unloads a module by removing references to it.
Here is the sequence of operations made by this function:
- Call package.loaded[name].__unload() if existing
- Clear: package.loaded[name]
- Clear: _G[name]
Parameter
-
name: the name of the module to unload.
Comment
Forum