Difference between revisions of "Lua:deAlloc"

From Cheat Engine
Jump to navigation Jump to search
(Created page with "Category:Lua {{CodeBox|'''function''' deAlloc(''address'', ''size'') ''':''' void}} Frees previously allocated memory. If ''size'' is provided, it specifies the size of...")
 
m (Syntax Highlighting.)
 
(One intermediate revision by the same user not shown)
Line 25: Line 25:
  
 
===Examples===
 
===Examples===
<pre>
+
<syntaxhighlight lang="lua" line>
 
local address = allocateMemory(1024)
 
local address = allocateMemory(1024)
  
Line 32: Line 32:
  
 
deAlloc(address, 1024)
 
deAlloc(address, 1024)
</pre>
+
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
 +
 +
{{Memory}}

Latest revision as of 16:31, 25 June 2026

<> Lua API Reference

function deAlloc(address, size) : void

Frees previously allocated memory.

If size is provided, it specifies the size of the memory block to free.

Function Parameters[edit]

Parameter Type Description
address Integer or CEAddressString The address of the allocated memory block to free.
size Integer (optional) The size of the memory block to free.

Returns[edit]

void — This function does not return any value.

Examples[edit]

1 local address = allocateMemory(1024)
2 
3 -- Use the allocated memory here
4 printf("Address: 0x%X",address)
5 
6 deAlloc(address, 1024)

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Sections / Views

Memory Mapping

Memory Copy / Compare

Memory Streams