Michael Hudson wrote: > Remove the ob_type field from all PyObjects. Make pymalloc mandatory, > make it use type specific pools and store a pointer to the type object > at the start of each pool. > > So instead of > p->ob_type > it's > *(p&MASK) > > I think having each type in its own pools would also let you lose the > gc_next & gc_prev fields. > > Combined with a non-refcount GC, you could hammer sizeof(PyIntObject) > down to sizeof(long)! Yes, this is a variant of an implementation technique used in early Lisp and Lisp-like language systems with types (e.g., Harvard's EL-1) back in the early 70's (at least--that's when I first encountered it). In those systems, you'd use the "page #" (higher-order bits) of a pointer to reference a type table. Good idea, but perhaps less effective these days where memory isn't quite so dear. (Back then, a large system was a PDP-10 with 256K 36-bit words, or around 1MB.) Cheers! --Chris Ryland / Em Software, Inc. / www.emsoftware.com
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4