mirror of
https://github.com/lua/lua.git
synced 2026-06-07 23:53:48 +00:00
Slightly better documentation for LUAI_MAXALIGN
This commit is contained in:
11
luaconf.h
11
luaconf.h
@@ -736,10 +736,17 @@
|
||||
|
||||
|
||||
/*
|
||||
@@ LUAI_MAXALIGN defines fields that, when used in a union, ensure
|
||||
** maximum alignment for the other items in that union.
|
||||
@@ LUAI_MAXALIGN defines fields that ensure proper alignment for
|
||||
** memory areas offered by Lua (e.g., userdata memory).
|
||||
** Add fields to it if you need alignment for non-ISO objects.
|
||||
*/
|
||||
#if defined(LLONG_MAX)
|
||||
/* use ISO C99 stuff */
|
||||
#define LUAI_MAXALIGN long double u; void *s; long long l
|
||||
#else
|
||||
/* use only C89 stuff */
|
||||
#define LUAI_MAXALIGN lua_Number n; double u; void *s; lua_Integer i; long l
|
||||
#endif
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
||||
@@ -3915,8 +3915,12 @@ like any Lua object.
|
||||
This function creates and pushes on the stack a new full userdata,
|
||||
with @id{nuvalue} associated Lua values, called @id{user values},
|
||||
plus an associated block of raw memory with @id{size} bytes.
|
||||
(The user values can be set and read with the functions
|
||||
@Lid{lua_setiuservalue} and @Lid{lua_getiuservalue}.)
|
||||
|
||||
The user values can be set and read with the functions
|
||||
@Lid{lua_setiuservalue} and @Lid{lua_getiuservalue}.
|
||||
The block of memory is suitably aligned for any @N{ISO C} object.
|
||||
(See macro @id{LUAI_MAXALIGN} in file @id{luaconf.h} for other
|
||||
alignment requirements.)
|
||||
|
||||
The function returns the address of the block of memory.
|
||||
Lua ensures that this address is valid as long as
|
||||
|
||||
Reference in New Issue
Block a user