Fix GC_new_kind in case of client-defined PREDEFINED_KINDS
authorIvan Maidanski <ivmai@mail.ru>
Sat, 30 Apr 2016 22:07:53 +0000 (01:07 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 30 Apr 2016 22:07:53 +0000 (01:07 +0300)
commit5e15c587ad259e38bb4c3e0bbf62583d014f18e5
tree951b215018dfef14cd412c9591beca80f24ebebb
parentf6dcff709def4a283efb462bfa254a87a6a50be2
Fix GC_new_kind in case of client-defined PREDEFINED_KINDS

There are 2 types of kinds - "pre-allocated" ones (with the number less
than PREDEFINED_KINDS) which have pre-allocated free lists and object
allocation for these kinds is dealt by GC_malloc_kind typically,
and "custom" kinds which require the client to supply the free list
(e.g., allocated by GC_new_free_list[_inner]) and arrange own object
allocation procedure.
By design, GC_new_kind[_inner] creates new "custom" kind.

* mark.c (GC_N_KINDS_INITIAL_VALUE): Simplify and comment out (for now).
* mark.c (GC_n_kinds): Initialize to PREDEFINED_KINDS (instead of
GC_N_KINDS_INITIAL_VALUE); add TODO item.
mark.c