Patent ID: 8205040

Claim:
A method comprising: selecting, by a processor, a longest run of contiguous unwritten pages from a plurality of runs of contiguous unwritten pages provided in a ternary content addressable memory; writing, by the processor, a rule on a page that is located at a middle portion of the longest run to create, from the longest run of contiguous unwritten pages, two runs of contiguous unwritten pages, writing the rule including: creating two run records to track, respectively, the two runs of contiguous unwritten pages, allocating, in a memory, two memory blocks for, respectively, the two run records, the memory differing from the ternary content addressable memory, writing, in a first field, a first reference to a first page, of the longest run, the first field being included in one of the two memory blocks, and writing, in a second field, a second reference to a last page, of the longest run, the second field being included in the other of the two memory blocks; retrieving, by the processor and in response to receiving a packet, the rule from the page in the ternary content addressable memory; and applying, by the processor, the rule to process the packet.