| /* | |
| * Copyright (c) 1999-2005 Hewlett-Packard Development Company, L.P. | |
| * | |
| * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED | |
| * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. | |
| * | |
| * Permission is hereby granted to use or copy this program | |
| * for any purpose, provided the above notices are retained on all copies. | |
| * Permission to modify the code and to distribute modified code is granted, | |
| * provided the above notices are retained, and a notice that the code was | |
| * modified is included with the above copyright notice. | |
| */ | |
| /* | |
| * Constants and data structures for "tiny" free lists. | |
| * These are used for thread-local allocation or in-lined allocators. | |
| * Each global free list also essentially starts with one of these. | |
| * However, global free lists are known to the GC. "Tiny" free lists | |
| * are basically private to the client. Their contents are viewed as | |
| * "in use" and marked accordingly by the core of the GC. | |
| * | |
| * Note that inlined code might know about the layout of these and the constants | |
| * involved. Thus any change here may invalidate clients, and such changes should | |
| * be avoided. Hence we keep this as simple as possible. | |
| */ | |
| /* | |
| * We always set GRANULE_BYTES to twice the length of a pointer. | |
| * This means that all allocation requests are rounded up to the next | |
| * multiple of 16 on 64-bit architectures or 8 on 32-bit architectures. | |
| * This appears to be a reasonable compromise between fragmentation overhead | |
| * and space usage for mark bits (usually mark bytes). | |
| * On many 64-bit architectures some memory references require 16-byte | |
| * alignment, making this necessary anyway. | |
| * For a few 32-bit architecture (e.g. x86), we may also need 16-byte alignment | |
| * for certain memory references. But currently that does not seem to be the | |
| * default for all conventional malloc implementations, so we ignore that | |
| * problem. | |
| * It would always be safe, and often useful, to be able to allocate very | |
| * small objects with smaller alignment. But that would cost us mark bit | |
| * space, so we no longer do so. | |
| */ | |
| /* GC_GRANULE_BYTES should not be overridden in any instances of the GC */ | |
| /* library that may be shared between applications, since it affects */ | |
| /* the binary interface to the library. */ | |
| /* A "tiny" free list header contains TINY_FREELISTS pointers to */ | |
| /* singly linked lists of objects of different sizes, the ith one */ | |
| /* containing objects i granules in size. Note that there is a list */ | |
| /* of size zero objects. */ | |
| /* The ith free list corresponds to size i*GRANULE_BYTES */ | |
| /* Internally to the collector, the index can be computed with */ | |
| /* ROUNDED_UP_GRANULES. Externally, we don't know whether */ | |
| /* DONT_ADD_BYTE_AT_END is set, but the client should know. */ | |
| /* Convert a free list index to the actual size of objects */ | |
| /* on that list, including extra space we added. Not an */ | |
| /* inverse of the above. */ | |