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 /lfunc.c | |
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 'lfunc.c')
-rw-r--r-- | lfunc.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lfunc.c,v 1.12 1999/10/04 17:51:04 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 1.13 1999/10/14 19:46:57 roberto Exp roberto $ |
3 | ** Auxiliary functions to manipulate prototypes and closures | 3 | ** Auxiliary functions to manipulate prototypes and closures |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -11,8 +11,8 @@ | |||
11 | #include "lmem.h" | 11 | #include "lmem.h" |
12 | #include "lstate.h" | 12 | #include "lstate.h" |
13 | 13 | ||
14 | #define gcsizeproto(p) 5 /* approximate "weight" for a prototype */ | 14 | #define gcsizeproto(p) numblocks(0, sizeof(TProtoFunc)) |
15 | #define gcsizeclosure(c) 1 /* approximate "weight" for a closure */ | 15 | #define gcsizeclosure(c) numblocks(c->nelems, sizeof(Closure)) |
16 | 16 | ||
17 | 17 | ||
18 | 18 | ||
@@ -21,8 +21,8 @@ Closure *luaF_newclosure (int nelems) { | |||
21 | c->next = L->rootcl; | 21 | c->next = L->rootcl; |
22 | L->rootcl = c; | 22 | L->rootcl = c; |
23 | c->marked = 0; | 23 | c->marked = 0; |
24 | L->nblocks += gcsizeclosure(c); | ||
25 | c->nelems = nelems; | 24 | c->nelems = nelems; |
25 | L->nblocks += gcsizeclosure(c); | ||
26 | return c; | 26 | return c; |
27 | } | 27 | } |
28 | 28 | ||