mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-24 05:20:17 +00:00
Minimum deleted slot required to refactor
This commit is contained in:
parent
b2d5708fd8
commit
8458e49a30
@ -12,8 +12,8 @@ if(MSVC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8 /Ox /jumptablerdata /GS-")
|
||||
add_compile_options(/wd4267 /wd4244)
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -frtti -O2")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -frtti")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
|
||||
# disable -Wshorten-64-to-32 for apple
|
||||
if(APPLE)
|
||||
|
||||
@ -101,7 +101,7 @@ static void pkpy_Dict__extendht(pkpy_Dict* self, void* vm) {
|
||||
|
||||
static bool pkpy_Dict__refactor(pkpy_Dict* self, void* vm) {
|
||||
int deleted_slots = self->_entries.count - self->count;
|
||||
if(deleted_slots < self->_entries.count * 0.25) return false;
|
||||
if(deleted_slots >= 8 && deleted_slots < self->_entries.count * 0.25) return false;
|
||||
|
||||
// shrink
|
||||
self->_version += 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user