aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lobject.h10
-rw-r--r--lstring.h2
2 files changed, 2 insertions, 10 deletions
diff --git a/lobject.h b/lobject.h
index df31a1a0..53e67932 100644
--- a/lobject.h
+++ b/lobject.h
@@ -350,21 +350,13 @@ typedef struct TString {
350} TString; 350} TString;
351 351
352 352
353/*
354** Ensures that address after this type is always fully aligned.
355*/
356typedef union UTString {
357 LUAI_MAXALIGN; /* ensures maximum alignment for strings */
358 TString tsv;
359} UTString;
360
361 353
362/* 354/*
363** Get the actual string (array of bytes) from a 'TString'. 355** Get the actual string (array of bytes) from a 'TString'.
364** (Access to 'extra' ensures that value is really a 'TString'.) 356** (Access to 'extra' ensures that value is really a 'TString'.)
365*/ 357*/
366#define getstr(ts) \ 358#define getstr(ts) \
367 check_exp(sizeof((ts)->extra), cast_charp((ts)) + sizeof(UTString)) 359 check_exp(sizeof((ts)->extra), cast_charp((ts)) + sizeof(TString))
368 360
369 361
370/* get the actual string (array of bytes) from a Lua value */ 362/* get the actual string (array of bytes) from a Lua value */
diff --git a/lstring.h b/lstring.h
index e7e4aedc..b2550218 100644
--- a/lstring.h
+++ b/lstring.h
@@ -19,7 +19,7 @@
19#define MEMERRMSG "not enough memory" 19#define MEMERRMSG "not enough memory"
20 20
21 21
22#define sizelstring(l) (sizeof(union UTString) + ((l) + 1) * sizeof(char)) 22#define sizelstring(l) (sizeof(TString) + ((l) + 1) * sizeof(char))
23 23
24#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ 24#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
25 (sizeof(s)/sizeof(char))-1)) 25 (sizeof(s)/sizeof(char))-1))