Skip to content

Commit 71c39d0

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

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Modules/_sqlite/connection.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,8 @@ static int
10601060
_pysqlite_drop_unused_blob_references(pysqlite_Connection* self)
10611061
{
10621062
/* we only need to do this once in a while */
1063-
if (self->created_blobs++ < 200) {
1063+
self->created_blobs++;
1064+
if (self->created_blobs < 200 || self->created_blobs < PyList_GET_SIZE(self->blobs) / 4) {
10641065
return 0;
10651066
}
10661067

0 commit comments

Comments
 (0)