/**
 * See Copyright Notice in picrin.h
 */

#ifndef GC_H__
#define GC_H__

#if defined(__cplusplus)
extern "C" {
#endif

enum pic_gc_mark {
  PIC_GC_UNMARK = 0,
  PIC_GC_MARK
};

union header {
  struct {
    union header *ptr;
    size_t size;
    enum pic_gc_mark mark : 1;
  } s;
  long alignment[2];
};

struct heap_page {
  union header *basep, *endp;
  struct heap_page *next;
};

struct pic_heap {
  union header base, *freep;
  struct heap_page *pages;
};

void init_heap(struct pic_heap *);
void finalize_heap(struct pic_heap *);

#if defined(__cplusplus)
}
#endif

#endif

/**
 * See Copyright Notice in picrin.h
 */

#ifndef GC_H__
#define GC_H__

#if defined(__cplusplus)
extern "C" {
#endif

#define PIC_GC_UNMARK 0
#define PIC_GC_MARK 1

union header {
  struct {
    union header *ptr;
    size_t size;
    unsigned int mark : 1;
  } s;
  long alignment[2];
};

struct heap_page {
  union header *basep, *endp;
  struct heap_page *next;
};

struct pic_heap {
  union header base, *freep;
  struct heap_page *pages;
};

void init_heap(struct pic_heap *);
void finalize_heap(struct pic_heap *);

#if defined(__cplusplus)
}
#endif

#endif

Define the type of marking flags as unsigned int.
Define the type of marking flags as unsigned int.

We could define it as _Bool since we are going to use C99, but unsigned
int is more portable (even in C89!) and extensible (when we decide to
use tri-color marking GC.)

Signed-off-by: OGINO Masanori <c49462fef669560e618607913e6c283f7627123c@gmail.com>
