Difference between revisions of "Lua:allocateSharedMemory"
Jump to navigation
Jump to search
(Created page with ''''function''' allocateSharedMemory(''size'') Creates a shared memory object of the given size if it doesn't exist yet. If size is not given and there is no shared region with t…') |
m (moved allocateSharedMemory to Lua:allocateSharedMemory) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | '''function''' allocateSharedMemory(''size'') | + | [[Category:Lua]] |
+ | '''function''' allocateSharedMemory(''name'', ''size'') | ||
Creates a shared memory object of the given size if it doesn't exist yet. If size is not given and there is no shared region with this name then the default size of 4096 is used | Creates a shared memory object of the given size if it doesn't exist yet. If size is not given and there is no shared region with this name then the default size of 4096 is used | ||
Line 13: | Line 14: | ||
!align="left"|Type | !align="left"|Type | ||
!style="width: 80%;background-color:white;" align="left"|Description | !style="width: 80%;background-color:white;" align="left"|Description | ||
+ | |- | ||
+ | |name | ||
+ | |string | ||
+ | |The name of the block to allocate | ||
|- | |- | ||
|size | |size | ||
Line 20: | Line 25: | ||
− | + | {{LuaSeeAlso}} | |
− |
Latest revision as of 00:01, 25 January 2018
function allocateSharedMemory(name, size)
Creates a shared memory object of the given size if it doesn't exist yet. If size is not given and there is no shared region with this name then the default size of 4096 is used
It then maps this shared memory block into the currently targeted process. It returns the address of mapped region in the target process
When the process closes, you can target another process and allocate the same block on there again. Then you can read the state before the process closed
Function Parameters[edit]
Parameter | Type | Description |
---|---|---|
name | string | The name of the block to allocate |
size | integer | The prefered size of the allocated block |