1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-07 18:10:21 +02:00

Move inline function decls to their impl headers

This commit is contained in:
Andy Wingo 2025-07-01 13:09:46 +02:00
parent 36043468e8
commit 86baf260cc
5 changed files with 54 additions and 54 deletions

View file

@ -6,6 +6,29 @@
struct gc_heap; struct gc_heap;
struct gc_mutator; struct gc_mutator;
static inline void gc_update_alloc_table(struct gc_ref obj, size_t size,
enum gc_allocation_kind kind) GC_ALWAYS_INLINE;
GC_API_ void* gc_allocate_slow(struct gc_mutator *mut, size_t bytes,
enum gc_allocation_kind kind) GC_NEVER_INLINE;
static inline void*
gc_allocate_small_fast_bump_pointer(struct gc_mutator *mut, size_t size,
enum gc_allocation_kind kind) GC_ALWAYS_INLINE;
static inline void* gc_allocate_small_fast_freelist(struct gc_mutator *mut,
size_t size,
enum gc_allocation_kind kind) GC_ALWAYS_INLINE;
static inline void* gc_allocate_small_fast(struct gc_mutator *mut, size_t size,
enum gc_allocation_kind kind) GC_ALWAYS_INLINE;
static inline void* gc_allocate_fast(struct gc_mutator *mut, size_t size,
enum gc_allocation_kind kind) GC_ALWAYS_INLINE;
static inline void* gc_allocate(struct gc_mutator *mut, size_t size,
enum gc_allocation_kind kind) GC_ALWAYS_INLINE;
static inline void gc_update_alloc_table(struct gc_ref obj, size_t size, static inline void gc_update_alloc_table(struct gc_ref obj, size_t size,
enum gc_allocation_kind kind) { enum gc_allocation_kind kind) {
size_t alignment = gc_allocator_alloc_table_alignment(); size_t alignment = gc_allocator_alloc_table_alignment();

View file

@ -68,62 +68,9 @@ GC_API_ void gc_collect(struct gc_mutator *mut,
GC_API_ int gc_heap_contains(struct gc_heap *heap, struct gc_ref ref); GC_API_ int gc_heap_contains(struct gc_heap *heap, struct gc_ref ref);
static inline void gc_update_alloc_table(struct gc_ref obj, size_t size,
enum gc_allocation_kind kind) GC_ALWAYS_INLINE;
GC_API_ void* gc_allocate_slow(struct gc_mutator *mut, size_t bytes,
enum gc_allocation_kind kind) GC_NEVER_INLINE;
static inline void*
gc_allocate_small_fast_bump_pointer(struct gc_mutator *mut, size_t size,
enum gc_allocation_kind kind) GC_ALWAYS_INLINE;
static inline void* gc_allocate_small_fast_freelist(struct gc_mutator *mut,
size_t size,
enum gc_allocation_kind kind) GC_ALWAYS_INLINE;
static inline void* gc_allocate_small_fast(struct gc_mutator *mut, size_t size,
enum gc_allocation_kind kind) GC_ALWAYS_INLINE;
static inline void* gc_allocate_fast(struct gc_mutator *mut, size_t size,
enum gc_allocation_kind kind) GC_ALWAYS_INLINE;
static inline void* gc_allocate(struct gc_mutator *mut, size_t size,
enum gc_allocation_kind kind) GC_ALWAYS_INLINE;
GC_API_ int gc_object_is_old_generation_slow(struct gc_mutator *mut,
struct gc_ref obj) GC_NEVER_INLINE;
static inline int gc_object_is_old_generation(struct gc_mutator *mut,
struct gc_ref obj,
size_t obj_size) GC_ALWAYS_INLINE;
GC_API_ void gc_write_barrier_slow(struct gc_mutator *mut, struct gc_ref obj,
size_t obj_size, struct gc_edge edge,
struct gc_ref new_val) GC_NEVER_INLINE;
static inline int gc_write_barrier_fast(struct gc_mutator *mut, struct gc_ref obj,
size_t obj_size, struct gc_edge edge,
struct gc_ref new_val) GC_ALWAYS_INLINE;
static inline void gc_write_barrier(struct gc_mutator *mut, struct gc_ref obj,
size_t obj_size, struct gc_edge edge,
struct gc_ref new_val) GC_ALWAYS_INLINE;
GC_API_ struct gc_ref gc_resolve_conservative_ref(struct gc_heap *heap, GC_API_ struct gc_ref gc_resolve_conservative_ref(struct gc_heap *heap,
struct gc_conservative_ref ref, struct gc_conservative_ref ref,
int possibly_interior); int possibly_interior);
GC_API_ void gc_pin_object(struct gc_mutator *mut, struct gc_ref obj); GC_API_ void gc_pin_object(struct gc_mutator *mut, struct gc_ref obj);
GC_API_ void gc_safepoint_slow(struct gc_mutator *mut) GC_NEVER_INLINE;
GC_API_ int* gc_safepoint_flag_loc(struct gc_mutator *mut);
static inline void gc_safepoint(struct gc_mutator *mut) GC_ALWAYS_INLINE;
GC_API_ int gc_safepoint_signal_number(void);
GC_API_ void gc_safepoint_signal_inhibit(struct gc_mutator *mut);
GC_API_ void gc_safepoint_signal_reallow(struct gc_mutator *mut);
static inline void gc_inhibit_preemption(struct gc_mutator *mut) GC_ALWAYS_INLINE;
static inline void gc_reallow_preemption(struct gc_mutator *mut) GC_ALWAYS_INLINE;
#endif // GC_API_H_ #endif // GC_API_H_

View file

@ -3,6 +3,25 @@
#include "gc-api.h" #include "gc-api.h"
GC_API_ int gc_object_is_old_generation_slow(struct gc_mutator *mut,
struct gc_ref obj) GC_NEVER_INLINE;
static inline int gc_object_is_old_generation(struct gc_mutator *mut,
struct gc_ref obj,
size_t obj_size) GC_ALWAYS_INLINE;
GC_API_ void gc_write_barrier_slow(struct gc_mutator *mut, struct gc_ref obj,
size_t obj_size, struct gc_edge edge,
struct gc_ref new_val) GC_NEVER_INLINE;
static inline int gc_write_barrier_fast(struct gc_mutator *mut, struct gc_ref obj,
size_t obj_size, struct gc_edge edge,
struct gc_ref new_val) GC_ALWAYS_INLINE;
static inline void gc_write_barrier(struct gc_mutator *mut, struct gc_ref obj,
size_t obj_size, struct gc_edge edge,
struct gc_ref new_val) GC_ALWAYS_INLINE;
static inline int gc_object_is_old_generation(struct gc_mutator *mut, static inline int gc_object_is_old_generation(struct gc_mutator *mut,
struct gc_ref obj, struct gc_ref obj,
size_t obj_size) { size_t obj_size) {

View file

@ -1,7 +1,7 @@
#ifndef GC_INLINE_H_ #ifndef GC_INLINE_H_
#define GC_INLINE_H_ #define GC_INLINE_H_
#define GC_ALWAYS_INLINE __attribute__((always_inline)) __attribute__((unused)) #define GC_ALWAYS_INLINE __attribute__((always_inline))
#define GC_NEVER_INLINE __attribute__((noinline)) #define GC_NEVER_INLINE __attribute__((noinline))
#endif // GC_INLINE_H_ #endif // GC_INLINE_H_

View file

@ -3,6 +3,17 @@
#include "gc-api.h" #include "gc-api.h"
GC_API_ void gc_safepoint_slow(struct gc_mutator *mut) GC_NEVER_INLINE;
GC_API_ int* gc_safepoint_flag_loc(struct gc_mutator *mut);
static inline void gc_safepoint(struct gc_mutator *mut) GC_ALWAYS_INLINE;
GC_API_ int gc_safepoint_signal_number(void);
GC_API_ void gc_safepoint_signal_inhibit(struct gc_mutator *mut);
GC_API_ void gc_safepoint_signal_reallow(struct gc_mutator *mut);
static inline void gc_inhibit_preemption(struct gc_mutator *mut) GC_ALWAYS_INLINE;
static inline void gc_reallow_preemption(struct gc_mutator *mut) GC_ALWAYS_INLINE;
static inline int gc_should_stop_for_safepoint(struct gc_mutator *mut) { static inline int gc_should_stop_for_safepoint(struct gc_mutator *mut) {
switch (gc_cooperative_safepoint_kind()) { switch (gc_cooperative_safepoint_kind()) {
case GC_COOPERATIVE_SAFEPOINT_NONE: case GC_COOPERATIVE_SAFEPOINT_NONE: