diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-11-10 13:39:35 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-11-10 13:39:35 -0200 |
| commit | d915cf4f9dbe525f8faeb4cb04df13d5f08692da (patch) | |
| tree | b166ca7e66e02999fee1500363c4d301b7e53951 /lobject.h | |
| parent | 53fb65d39451f9245d8ed555f941829520ee6f24 (diff) | |
| download | lua-d915cf4f9dbe525f8faeb4cb04df13d5f08692da.tar.gz lua-d915cf4f9dbe525f8faeb4cb04df13d5f08692da.tar.bz2 lua-d915cf4f9dbe525f8faeb4cb04df13d5f08692da.zip | |
ways to measure number of `blocks' for GC + details
Diffstat (limited to 'lobject.h')
| -rw-r--r-- | lobject.h | 14 |
1 files changed, 12 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.h,v 1.34 1999/10/19 13:33:22 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 1.35 1999/11/04 17:22:26 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 | */ |
| @@ -43,7 +43,17 @@ typedef unsigned char Byte; /* unsigned 8 bits */ | |||
| 43 | 43 | ||
| 44 | #define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ | 44 | #define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ |
| 45 | 45 | ||
| 46 | typedef unsigned int IntPoint; /* unsigned with same size as a pointer (for hashing) */ | 46 | |
| 47 | /* convertion of pointer to int (for hashing only) */ | ||
| 48 | #define IntPoint(p) ((unsigned int)(p)) | ||
| 49 | |||
| 50 | |||
| 51 | /* | ||
| 52 | ** number of `blocks' for garbage collection: each reference to other | ||
| 53 | ** objects count 1, and each 32 bytes of `raw' memory count 1; we add | ||
| 54 | ** 2 to the total as a minimum (and also to count the overhead of malloc) | ||
| 55 | */ | ||
| 56 | #define numblocks(o,b) ((o)+(b)/32+2) | ||
| 47 | 57 | ||
| 48 | 58 | ||
| 49 | /* | 59 | /* |
