1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-19 03:00:25 +02:00

Add bdw-inline.h

This commit is contained in:
Andy Wingo 2022-08-15 18:30:42 +02:00
parent 8f2f4f7c69
commit 33aa5230da
4 changed files with 59 additions and 54 deletions

52
bdw-inline.h Normal file
View file

@ -0,0 +1,52 @@
#ifndef BDW_INLINE_H
#define BDW_INLINE_H
#include "gc-api.h"
static inline enum gc_allocator_kind gc_allocator_kind(void) {
return GC_ALLOCATOR_INLINE_FREELIST;
}
static inline size_t gc_allocator_small_granule_size(void) {
return 2 * sizeof(void *);
}
static inline size_t gc_allocator_large_threshold(void) {
return 256;
}
static inline size_t gc_allocator_allocation_pointer_offset(void) {
abort();
}
static inline size_t gc_allocator_allocation_limit_offset(void) {
abort();
}
static inline size_t gc_allocator_freelist_offset(size_t size) {
GC_ASSERT(size);
return sizeof(void*) * ((size - 1) / gc_allocator_small_granule_size());
}
static inline size_t gc_allocator_alloc_table_alignment(void) {
return 0;
}
static inline uint8_t gc_allocator_alloc_table_begin_pattern(void) {
abort();
}
static inline uint8_t gc_allocator_alloc_table_end_pattern(void) {
abort();
}
static inline int gc_allocator_needs_clear(void) {
return 0;
}
static inline enum gc_write_barrier_kind gc_small_write_barrier_kind(void) {
return GC_WRITE_BARRIER_NONE;
}
static inline size_t gc_small_write_barrier_card_table_alignment(void) {
abort();
}
static inline size_t gc_small_write_barrier_card_size(void) {
abort();
}
#endif // BDW_INLINE_H