Difference between revisions of "Data:getFFIPointer"

(Created page with "{{newin|11.3|113|type=function}} Gets an [http://luajit.org/ext_ffi.html FFI] pointer to the Data. This function should be preferred instead of Data:getPointer becaus...")
 
m (Add notice from Data:getPointer)
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
[[light userdata]] which can't store more all possible memory addresses on some new ARM64
 
[[light userdata]] which can't store more all possible memory addresses on some new ARM64
 
architectures, when LuaJIT is used.
 
architectures, when LuaJIT is used.
 +
{{notice|Use at your own risk. Directly reading from and writing to the raw memory owned by the Data will bypass any safety checks and thread-safety the Data might normally have.}}
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
Line 22: Line 23:
 
{{#set:Description=Gets an FFI pointer to the Data.}}
 
{{#set:Description=Gets an FFI pointer to the Data.}}
 
== Other Languages ==
 
== Other Languages ==
{{i18n|Data:getPointer}}
+
{{i18n|Data:getFFIPointer}}

Revision as of 13:58, 29 July 2020

Available since LÖVE 11.3
This function is not supported in earlier versions.

Gets an FFI pointer to the Data.

This function should be preferred instead of Data:getPointer because the latter uses light userdata which can't store more all possible memory addresses on some new ARM64 architectures, when LuaJIT is used.

O.png Use at your own risk. Directly reading from and writing to the raw memory owned by the Data will bypass any safety checks and thread-safety the Data might normally have.  


Function

Synopsis

pointer = Data:getFFIPointer( )

Arguments

None.

Returns

cdata pointer
A raw void* pointer to the Data, or nil if FFI is unavailable.

See Also

Other Languages