aboutsummaryrefslogtreecommitdiff
path: root/lstring.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-02-09 18:22:29 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-02-09 18:22:29 -0200
commitd2e340f467a46017fa3526074c1756124e569880 (patch)
treee5b08773a0f0734193b0c1c435fab8ee243f08dc /lstring.h
parent6875fdc8be9029b1bb29379c59d5409a0df42c10 (diff)
downloadlua-d2e340f467a46017fa3526074c1756124e569880.tar.gz
lua-d2e340f467a46017fa3526074c1756124e569880.tar.bz2
lua-d2e340f467a46017fa3526074c1756124e569880.zip
string pointers are always fully aligned
Diffstat (limited to 'lstring.h')
-rw-r--r--lstring.h15
1 files changed, 2 insertions, 13 deletions
diff --git a/lstring.h b/lstring.h
index 5c9c7c36..7598783c 100644
--- a/lstring.h
+++ b/lstring.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstring.h,v 1.27 2001/01/10 17:41:50 roberto Exp roberto $ 2** $Id: lstring.h,v 1.28 2001/02/09 19:53:16 roberto Exp roberto $
3** String table (keep all strings handled by Lua) 3** String table (keep all strings handled by Lua)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -14,16 +14,6 @@
14 14
15 15
16/* 16/*
17** type equivalent to TString, but with maximum alignment requirements
18*/
19union L_UTString {
20 TString ts;
21 union L_Umaxalign dummy; /* ensures maximum alignment for `local' udata */
22};
23
24
25
26/*
27** any TString with mark>=FIXMARK is never collected. 17** any TString with mark>=FIXMARK is never collected.
28** Marks>=RESERVEDMARK are used to identify reserved words. 18** Marks>=RESERVEDMARK are used to identify reserved words.
29*/ 19*/
@@ -31,8 +21,7 @@ union L_UTString {
31#define RESERVEDMARK 3 21#define RESERVEDMARK 3
32 22
33 23
34#define sizestring(l) ((lint32)sizeof(TString) + \ 24#define sizestring(l) ((luint32)sizeof(union L_UTString)+(l)+1)
35 ((lint32)(l+1)-TSPACK)*(lint32)sizeof(char))
36 25
37#define sizeudata(l) ((luint32)sizeof(union L_UTString)+(l)) 26#define sizeudata(l) ((luint32)sizeof(union L_UTString)+(l))
38 27