diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-07 12:01:21 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-07 12:01:21 -0300 |
| commit | ba11831d357889ee090ce92ff508957c6c023c42 (patch) | |
| tree | d54958d74c7fc1d5b751bf4819ed7345e3b6e69b /lobject.h | |
| parent | 190ddd431dd9f14148d232ed9a72db482a1df934 (diff) | |
| download | lua-ba11831d357889ee090ce92ff508957c6c023c42.tar.gz lua-ba11831d357889ee090ce92ff508957c6c023c42.tar.bz2 lua-ba11831d357889ee090ce92ff508957c6c023c42.zip | |
smaller structs for udata and for strings
Diffstat (limited to 'lobject.h')
| -rw-r--r-- | lobject.h | 13 |
1 files changed, 8 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.h,v 1.103 2001/06/05 18:17:01 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 1.104 2001/06/06 18:00:19 roberto Exp roberto $ |
| 3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -82,9 +82,9 @@ typedef TObject *StkId; /* index to stack elements */ | |||
| 82 | */ | 82 | */ |
| 83 | typedef struct TString { | 83 | typedef struct TString { |
| 84 | lu_hash hash; | 84 | lu_hash hash; |
| 85 | int constindex; /* hint to reuse constants */ | ||
| 86 | size_t len; | 85 | size_t len; |
| 87 | int marked; | 86 | unsigned short constindex; /* hint to reuse constants */ |
| 87 | short marked; | ||
| 88 | struct TString *nexthash; /* chain for hash table */ | 88 | struct TString *nexthash; /* chain for hash table */ |
| 89 | } TString; | 89 | } TString; |
| 90 | 90 | ||
| @@ -105,14 +105,17 @@ union L_UTString { | |||
| 105 | 105 | ||
| 106 | 106 | ||
| 107 | typedef struct Udata { | 107 | typedef struct Udata { |
| 108 | int tag; | 108 | int tag; /* negative means `marked' (only during GC) */ |
| 109 | void *value; | 109 | void *value; |
| 110 | size_t len; | 110 | size_t len; |
| 111 | int marked; | ||
| 112 | struct Udata *next; /* chain for list of all udata */ | 111 | struct Udata *next; /* chain for list of all udata */ |
| 113 | } Udata; | 112 | } Udata; |
| 114 | 113 | ||
| 115 | 114 | ||
| 115 | #define switchudatamark(u) ((u)->tag = (-((u)->tag+1))) | ||
| 116 | #define ismarkedudata(u) ((u)->tag < 0) | ||
| 117 | |||
| 118 | |||
| 116 | 119 | ||
| 117 | /* | 120 | /* |
| 118 | ** Function Prototypes | 121 | ** Function Prototypes |
