Skip to content
Snippets Groups Projects
Commit 8d92615f authored by Luigi Scarso's avatar Luigi Scarso
Browse files

ffi.h: do not assume that struct cdata is aligned(16). More fixes for luaffi. LuaTeX 1.20.2

parent 147871ce
No related branches found
No related tags found
No related merge requests found
2025-01-04 Luigi Scarso <luigi.scarso@gmail.com>
* ffi.h: do not assume that struct cdata is aligned(16).
* More fixes for luaffi.
* LuaTeX 1.20.2
2025-01-06 Luigi Scarso <luigi.scarso@gmail.com>
* Clean-up ffi.h
* LuaTeX 1.20.1
......
......@@ -164,9 +164,9 @@ void* push_cdata(lua_State* L, int ct_usr, const struct ctype* ct)
*/
/* Changed:To allow fast write to memory for struct in 64-bit machine in jit
*/
//if (ct->has_bitfield) {
sz = ALIGN_UP(sz, 7);
//}
if (ct->has_bitfield) {
sz = ALIGN_UP(sz, 7);
}
cd = (struct cdata*) lua_newuserdata(L, sizeof(struct cdata) + sz);
*(struct ctype*) &cd->type = *ct;
......@@ -246,7 +246,8 @@ err:
luaL_error(L, "expected cdata, ctype or string for arg #%d", idx);
}
static ALWAYS_INLINE int is_cdata(lua_State* L, int idx){
/* static ALWAYS_INLINE int is_cdata(lua_State* L, int idx){*/
static int is_cdata(lua_State* L, int idx){
if (!lua_isuserdata(L, idx) || !lua_getmetatable(L, idx)) {
lua_pushnil(L);
return 0;
......@@ -288,6 +289,8 @@ void* to_cdata(lua_State* L, int idx, struct ctype* ct)
return NULL;
cd = (struct cdata*) lua_touserdata(L, idx);
if (!cd) {lua_pushnil(L);return NULL;}
*ct = cd->type;
lua_getuservalue(L, idx);
......
......@@ -456,9 +456,9 @@ __declspec(align(16))
#endif
struct cdata {
const struct ctype type
#ifdef __GNUC__
__attribute__ ((aligned(16)))
#endif
/* #ifdef __GNUC__ */
/* __attribute__ ((aligned(16))) */
/* #endif */
;
};
......
......@@ -33,8 +33,8 @@
*/
int luatex_version = 120;
int luatex_revision = '1';
const char *luatex_version_string = "1.20.1";
int luatex_revision = '2';
const char *luatex_version_string = "1.20.2";
const char *engine_name = my_name;
#include <kpathsea/c-ctype.h>
......
#ifndef luatex_svn_revision_h
#define luatex_svn_revision_h
#define luatex_svn_revision 7637
#define luatex_svn_revision 7638
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment