Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ option(CUSTOM_ALLOCATORS "CUSTOM_ALLOCATORS" ON)
option(SAVE_SNAPSHOT "SAVE_SNAPSHOT" ON)
option(SAVE_INFO "SAVE_INFO" ON)
option(MMAP "MMAP" ON)
option(LAZY_RC "LAZY_RC" OFF)
option(RUNTIME_STATS "RUNTIME_STATS" OFF)
option(BSYMBOLIC "Link with -Bsymbolic to reduce call overhead in shared libraries (Linux)" ON)
option(USE_GMP "USE_GMP" ON)
Expand Down Expand Up @@ -139,10 +138,6 @@ if(WFAIL MATCHES "ON")
string(APPEND LEAN_EXTRA_MAKE_OPTS " -DwarningAsError=true")
endif()

if(LAZY_RC MATCHES "ON")
set(LEAN_LAZY_RC "#define LEAN_LAZY_RC")
endif()

if(USE_MIMALLOC)
set(LEAN_MIMALLOC "#define LEAN_MIMALLOC")
endif()
Expand Down
1 change: 0 additions & 1 deletion src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ Author: Leonardo de Moura
#include <lean/version.h>

@LEAN_MIMALLOC@
@LEAN_LAZY_RC@
@LEAN_IS_STAGE0@
16 changes: 0 additions & 16 deletions src/runtime/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,19 +345,7 @@ static inline void dec(lean_object * o, lean_object* & todo) {
}
}

#ifdef LEAN_LAZY_RC
LEAN_THREAD_PTR(object, g_to_free);
#endif

static object * lean_del_core(object * o, object * todo);

extern "C" LEAN_EXPORT lean_object * lean_alloc_object(size_t sz) {
#ifdef LEAN_LAZY_RC
if (g_to_free) {
object * o = pop_back(g_to_free);
g_to_free = lean_del_core(o, g_to_free);
}
#endif
#ifdef LEAN_MIMALLOC
void * r = mi_malloc(sz);
if (r == nullptr) lean_internal_panic_out_of_memory();
Expand Down Expand Up @@ -473,17 +461,13 @@ extern "C" LEAN_EXPORT void lean_dec_ref_cold(lean_object * o) {
if (std::atomic_fetch_add_explicit(lean_get_rc_mt_addr(o), 1, std::memory_order_acq_rel) != -1)
return;
}
#ifdef LEAN_LAZY_RC
push_back(g_to_free, o);
#else
object * todo = nullptr;
while (true) {
todo = lean_del_core(o, todo);
if (todo == nullptr)
return;
o = pop_back(todo);
}
#endif
}


Expand Down
Loading