diff options
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 | ||
