aboutsummaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-11-10 13:39:35 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-11-10 13:39:35 -0200
commitd915cf4f9dbe525f8faeb4cb04df13d5f08692da (patch)
treeb166ca7e66e02999fee1500363c4d301b7e53951 /lobject.h
parent53fb65d39451f9245d8ed555f941829520ee6f24 (diff)
downloadlua-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.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/lobject.h b/lobject.h
index 364653a1..9956d5cf 100644
--- a/lobject.h
+++ b/lobject.h
@@ -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
46typedef 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/*