Skip to content

Commit ba8b3ce

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

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
@@ -1101,7 +1101,8 @@ static int
11011101
_pysqlite_drop_unused_blob_references(pysqlite_Connection* self)
11021102
{
11031103
/* we only need to do this once in a while */
1104-
if (self->created_blobs++ < 200) {
1104+
self->created_blobs++;
1105+
if (self->created_blobs < 200 || self->created_blobs < PyList_GET_SIZE(self->blobs) / 4) {
11051106
return 0;
11061107
}
11071108

0 commit comments

Comments
 (0)