mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-16 18:50:23 +02:00
Refactor to separate gcbench from gc
This commit is contained in:
parent
77ac530360
commit
f57a1b8a55
10 changed files with 132 additions and 101 deletions
30
gcbench-types.h
Normal file
30
gcbench-types.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef GCBENCH_TYPES_H
|
||||
#define GCBENCH_TYPES_H
|
||||
|
||||
#include "inline.h"
|
||||
|
||||
#define FOR_EACH_HEAP_OBJECT_KIND(M) \
|
||||
M(node, Node, NODE) \
|
||||
M(double_array, DoubleArray, DOUBLE_ARRAY)
|
||||
|
||||
#define DECLARE_NODE_TYPE(name, Name, NAME) \
|
||||
struct Name; \
|
||||
typedef struct Name Name;
|
||||
FOR_EACH_HEAP_OBJECT_KIND(DECLARE_NODE_TYPE)
|
||||
#undef DECLARE_NODE_TYPE
|
||||
|
||||
#define DEFINE_ENUM(name, Name, NAME) ALLOC_KIND_##NAME,
|
||||
enum alloc_kind {
|
||||
FOR_EACH_HEAP_OBJECT_KIND(DEFINE_ENUM)
|
||||
};
|
||||
#undef DEFINE_ENUM
|
||||
|
||||
#define DEFINE_METHODS(name, Name, NAME) \
|
||||
static inline size_t name##_size(Name *obj) ALWAYS_INLINE; \
|
||||
static inline void visit_##name##_fields(Name *obj,\
|
||||
void (*visit)(void **loc, void *visit_data), \
|
||||
void *visit_data) ALWAYS_INLINE;
|
||||
FOR_EACH_HEAP_OBJECT_KIND(DEFINE_METHODS)
|
||||
#undef DEFINE_METHODS
|
||||
|
||||
#endif // GCBENCH_TYPES_H
|
Loading…
Add table
Add a link
Reference in a new issue