diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-09-29 09:42:13 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-09-29 09:42:13 -0300 |
| commit | dad808a73a98a23729614b8814728d76b4e5d577 (patch) | |
| tree | 945fabce1906c5f08fe6512476d7ca3d84017bca /llimits.h | |
| parent | ca7fd50a4ec2f1b41292f859ba0d5e52a2b22a5c (diff) | |
| download | lua-dad808a73a98a23729614b8814728d76b4e5d577.tar.gz lua-dad808a73a98a23729614b8814728d76b4e5d577.tar.bz2 lua-dad808a73a98a23729614b8814728d76b4e5d577.zip | |
new way to count `nblocks' for GC (try to count bytes).
Diffstat (limited to 'llimits.h')
| -rw-r--r-- | llimits.h | 11 |
1 files changed, 2 insertions, 9 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llimits.h,v 1.13 2000/08/28 17:57:04 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.14 2000/08/29 14:48:16 roberto Exp roberto $ |
| 3 | ** Limits, basic types, and some other "installation-dependent" definitions | 3 | ** Limits, basic types, and some other "installation-dependent" definitions |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -57,13 +57,6 @@ typedef unsigned long lint32; /* unsigned int with at least 32 bits */ | |||
| 57 | #define IntPoint(p) (((unsigned long)(p)) >> 3) | 57 | #define IntPoint(p) (((unsigned long)(p)) >> 3) |
| 58 | 58 | ||
| 59 | 59 | ||
| 60 | /* | ||
| 61 | ** number of `blocks' for garbage collection: each reference to other | ||
| 62 | ** objects count 1, and each 32 bytes of `raw' memory count 1; we add | ||
| 63 | ** 2 to the total as a minimum (and also to count the overhead of malloc) | ||
| 64 | */ | ||
| 65 | #define numblocks(L, o,b) ((o)+((b)>>5)+2) | ||
| 66 | |||
| 67 | 60 | ||
| 68 | #define MINPOWER2 4 /* minimum size for "growing" vectors */ | 61 | #define MINPOWER2 4 /* minimum size for "growing" vectors */ |
| 69 | 62 | ||
| @@ -77,7 +70,7 @@ typedef unsigned long lint32; /* unsigned int with at least 32 bits */ | |||
| 77 | 70 | ||
| 78 | /* | 71 | /* |
| 79 | ** type for virtual-machine instructions | 72 | ** type for virtual-machine instructions |
| 80 | ** must be an unsigned with 4 bytes (see details in lopcodes.h) | 73 | ** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) |
| 81 | ** For a very small machine, you may change that to 2 bytes (and adjust | 74 | ** For a very small machine, you may change that to 2 bytes (and adjust |
| 82 | ** the following limits accordingly) | 75 | ** the following limits accordingly) |
| 83 | */ | 76 | */ |
