mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-16 00:30:21 +02:00
Merged Whippet into libguile/whippet
This commit is contained in:
commit
db181e67ff
112 changed files with 18115 additions and 0 deletions
21
libguile/whippet/benchmarks/simple-allocator.h
Normal file
21
libguile/whippet/benchmarks/simple-allocator.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#ifndef SIMPLE_ALLOCATOR_H
|
||||
#define SIMPLE_ALLOCATOR_H
|
||||
|
||||
#include "simple-tagging-scheme.h"
|
||||
#include "gc-api.h"
|
||||
|
||||
static inline void*
|
||||
gc_allocate_with_kind(struct gc_mutator *mut, enum alloc_kind kind, size_t bytes) {
|
||||
void *obj = gc_allocate(mut, bytes, GC_ALLOCATION_TAGGED);
|
||||
*tag_word(gc_ref_from_heap_object(obj)) = tag_live(kind);
|
||||
return obj;
|
||||
}
|
||||
|
||||
static inline void*
|
||||
gc_allocate_pointerless_with_kind(struct gc_mutator *mut, enum alloc_kind kind, size_t bytes) {
|
||||
void *obj = gc_allocate(mut, bytes, GC_ALLOCATION_TAGGED_POINTERLESS);
|
||||
*tag_word(gc_ref_from_heap_object(obj)) = tag_live(kind);
|
||||
return obj;
|
||||
}
|
||||
|
||||
#endif // SIMPLE_ALLOCATOR_H
|
Loading…
Add table
Add a link
Reference in a new issue