GNU Emacs, memory usage, releasing

Kyle Jones kjones at talos.uu.net
Fri Jan 5 04:09:57 AEST 1990


Doug McDonald writes about the pointer munging in GNU Emacs:
 > This seems to me to be disgusting. Why not just define these
 > "things" (the pointer with 8 bits of something else stuck in somewhere)
 > as 
 > 
 > struct THING {
 > char * ptr;
 > char tag;
 > }
 > 
 > ?

Memory savings.  By making packing the type and garbage collection mark
bits into an object pointer, you get considerable saving per object.
That extra char for the tag can cost one to three extra bytes of storage,
due to the padding needed within the struct.

 > What will happen to the original method on machines that NEED a
 > full 32 (or 16 or 36) bits for a pointer (segmented architectures,
 > or 36 bit architectures)?  Won't it fail to compile?

Emacs could probably run on 36-bit machines, given the appopriate config
files.  16-bit machines can forget it, though.



More information about the Comp.lang.c mailing list