diff options
| author | Roberto I <roberto@inf.puc-rio.br> | 2026-03-09 16:23:03 -0300 |
|---|---|---|
| committer | Roberto I <roberto@inf.puc-rio.br> | 2026-03-09 16:23:03 -0300 |
| commit | 9e501d9855e560b08c50fb0cf6e147af93bb497e (patch) | |
| tree | a046f92754531ed18cfaa8480cd39f3d9ea70e7e | |
| parent | 10eb89d1141dc528806b32401e408e36fb2f3bf5 (diff) | |
| download | lua-9e501d9855e560b08c50fb0cf6e147af93bb497e.tar.gz lua-9e501d9855e560b08c50fb0cf6e147af93bb497e.tar.bz2 lua-9e501d9855e560b08c50fb0cf6e147af93bb497e.zip | |
Slightly better documentation for LUAI_MAXALIGN
Diffstat (limited to '')
| -rw-r--r-- | luaconf.h | 11 | ||||
| -rw-r--r-- | manual/manual.of | 8 |
2 files changed, 15 insertions, 4 deletions
| @@ -736,10 +736,17 @@ | |||
| 736 | 736 | ||
| 737 | 737 | ||
| 738 | /* | 738 | /* |
| 739 | @@ LUAI_MAXALIGN defines fields that, when used in a union, ensure | 739 | @@ LUAI_MAXALIGN defines fields that ensure proper alignment for |
| 740 | ** maximum alignment for the other items in that union. | 740 | ** memory areas offered by Lua (e.g., userdata memory). |
| 741 | ** Add fields to it if you need alignment for non-ISO objects. | ||
| 741 | */ | 742 | */ |
| 743 | #if defined(LLONG_MAX) | ||
| 744 | /* use ISO C99 stuff */ | ||
| 745 | #define LUAI_MAXALIGN long double u; void *s; long long l | ||
| 746 | #else | ||
| 747 | /* use only C89 stuff */ | ||
| 742 | #define LUAI_MAXALIGN lua_Number n; double u; void *s; lua_Integer i; long l | 748 | #define LUAI_MAXALIGN lua_Number n; double u; void *s; lua_Integer i; long l |
| 749 | #endif | ||
| 743 | 750 | ||
| 744 | /* }================================================================== */ | 751 | /* }================================================================== */ |
| 745 | 752 | ||
diff --git a/manual/manual.of b/manual/manual.of index 18c187f4..5eb2fb1f 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
| @@ -3915,8 +3915,12 @@ like any Lua object. | |||
| 3915 | This function creates and pushes on the stack a new full userdata, | 3915 | This function creates and pushes on the stack a new full userdata, |
| 3916 | with @id{nuvalue} associated Lua values, called @id{user values}, | 3916 | with @id{nuvalue} associated Lua values, called @id{user values}, |
| 3917 | plus an associated block of raw memory with @id{size} bytes. | 3917 | plus an associated block of raw memory with @id{size} bytes. |
| 3918 | (The user values can be set and read with the functions | 3918 | |
| 3919 | @Lid{lua_setiuservalue} and @Lid{lua_getiuservalue}.) | 3919 | The user values can be set and read with the functions |
| 3920 | @Lid{lua_setiuservalue} and @Lid{lua_getiuservalue}. | ||
| 3921 | The block of memory is suitably aligned for any @N{ISO C} object. | ||
| 3922 | (See macro @id{LUAI_MAXALIGN} in file @id{luaconf.h} for other | ||
| 3923 | alignment requirements.) | ||
| 3920 | 3924 | ||
| 3921 | The function returns the address of the block of memory. | 3925 | The function returns the address of the block of memory. |
| 3922 | Lua ensures that this address is valid as long as | 3926 | Lua ensures that this address is valid as long as |
