Xref: utzoo comp.lang.scheme:2137 comp.lang.lisp:4610 comp.lang.smalltalk:2739 Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!world!paradigm!gjc From: gjc@paradigm.com Newsgroups: comp.lang.scheme,comp.lang.lisp,comp.lang.smalltalk Subject: Re: implementing an interpreter Message-ID: <3653@paradigm.com> Date: 14 Mar 91 17:42:32 GMT References: <1991Mar8.153120.19836@tripos.com> <50211@apple.Apple.COM> Distribution: comp Organization: Paradigm Associates Inc, Cambridge MA Lines: 33 In article <50211@apple.Apple.COM>, mikel@Apple.COM (Mikel Evins) writes: > > A third approach is the Big Bag of Pages (BiBoP) arrangement, in > which objects of various types are each allocated only in certain > ranges of addresses. In this way, an object's type can be > determined by examining its address. This scheme somewhat complicates > an already somewhat complicated gc algorithm if you plan to > use, let us say, generation scavenging, but type determination > is fairly cheap. No heaper than the smalltalk technique that the poster mentioned. (Because of the extra shift. Although you may need a shift anyway). In fact, as far as types are concerned the smalltalk technique could be considered BIBOP with a page size of 1 word. int bibop_typeof(ptr) LISP ptr; {return(type_table[((long)ptr) >> 9].typeof);} Although specific type checking is usually optimized by having a precooked set of bits, thereby avoiding: (defun numberp (x) (memq (type-of x) '(fixnum bignum flonum)) Instead: LISP numberp(ptr) LISP ptr; {if (type_table[((long)ptr) >> 9].numberp) return(A_TRUE_VALUE); else return(A_FALSE_VALUE);}