Skip to content

Commit 1f39cb2

Browse files
Longer intervals between weakref cleanups if list is growing
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent b8f604e commit 1f39cb2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Modules/_sqlite/connection.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,8 @@ static int
11061106
_pysqlite_drop_unused_blob_references(pysqlite_Connection* self)
11071107
{
11081108
/* we only need to do this once in a while */
1109-
if (self->created_blobs++ < 200) {
1109+
self->created_blobs++;
1110+
if (self->created_blobs < 200 || self->created_blobs < PyList_GET_SIZE(self->blobs) / 4) {
11101111
return 0;
11111112
}
11121113

0 commit comments

Comments
 (0)