diff --git a/codon/runtime/lib.h b/codon/runtime/lib.h index 886d8243..a63d01c5 100644 --- a/codon/runtime/lib.h +++ b/codon/runtime/lib.h @@ -56,6 +56,8 @@ SEQ_FUNC void seq_assert_failed(seq_str_t file, seq_int_t line); SEQ_FUNC void *seq_alloc(size_t n); SEQ_FUNC void *seq_alloc_atomic(size_t n); +SEQ_FUNC void *seq_alloc_uncollectable(size_t n); +SEQ_FUNC void *seq_alloc_atomic_uncollectable(size_t n); SEQ_FUNC void *seq_calloc(size_t m, size_t n); SEQ_FUNC void *seq_calloc_atomic(size_t m, size_t n); SEQ_FUNC void *seq_realloc(void *p, size_t newsize, size_t oldsize); diff --git a/codon/runtime/re.cpp b/codon/runtime/re.cpp index fc808612..bfb6204f 100644 --- a/codon/runtime/re.cpp +++ b/codon/runtime/re.cpp @@ -75,7 +75,7 @@ template struct GCMapAllocator : public std::allocator { template GCMapAllocator(const GCMapAllocator &) noexcept {} - KV *allocate(std::size_t n) { return (KV *)seq_alloc(n * sizeof(KV)); } + KV *allocate(std::size_t n) { return (KV *)seq_alloc_uncollectable(n * sizeof(KV)); } void deallocate(KV *p, std::size_t n) { seq_free(p); }