Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#3956 closed Enhancement (fixed)

tr_bencFree() could be faster

Reported by: jordan Owned by: jordan
Priority: Normal Milestone: 2.20
Component: libtransmission Version: 2.13
Severity: Minor Keywords:
Cc:

Description

tr_bencFree() calls the private function tr_bencWalk(), which internally sorts the benc dictionaries so that iterating over them does so in a sorted fashion as required by benc dictionaries.

However when we're just freeing the structures, this is overkill. We should have an argument to tr_bencWalk() to avoid this overhead when it's being invoked from tr_bencFree().

Attachments (1)

bencode.diff (4.6 KB) - added by jordan 11 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 11 years ago by jordan

  • Status changed from new to assigned

Changed 11 years ago by jordan

comment:2 Changed 11 years ago by jordan

  • Milestone changed from 2.30 to 2.20

comment:3 Changed 11 years ago by jordan

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in trunk by r11780

comment:4 Changed 11 years ago by jordan

jordan * r11806 libtransmission/bencode.c:

(trunk libT) #3956 "tr_bencFree() could be faster" -- fix memory error.

#3956's r11780 has uncovered a longstanding memory error that occurs when tr_bencParse() fails to parse a dict and leaves a dangling key. This is fixed by cleaning up the key.

Note: See TracTickets for help on using tickets.