From: matthew.khouzam@ericsson.com (Matthew Khouzam)
Subject: [ltt-dev] [PATCH RFC] Seek fix
Date: Wed, 3 Nov 2010 14:25:10 -0400 [thread overview]
Message-ID: <4CD1A906.4000307@ericsson.com> (raw)
Message-ID: <20101103182510.5PDFCGwJ3ABZIsWp20oYc45PAZpZTpjoO5DkKUBvLYU@z> (raw)
I am including an example to better illustrace my fix.
the current binary search has a case where high can be lower then low.
An example: 51 blocks, the element is somewhere in the 12th block.
trace of before :
low : 0, high 51 , block_num -1
low : 0, high 24 , block_num 25
low : 13, high 24 , block_num 12
low : 13, high 17 , block_num 18
low : 13, high 14 , block_num 15
low : 13, high 12 , block_num 13
This will assert and fail.
The trace after will produce the following walkthrough
low : 0, high 51 , block_num -1
low : 0, high 24 , block_num 25
low : 0, high 24 , block_num 12
Found!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: seek_fix.patch
Type: text/x-patch
Size: 757 bytes
Desc: not available
URL: <http://lists.casi.polymtl.ca/pipermail/lttng-dev/attachments/20101103/f76b1641/attachment-0003.bin>
next reply other threads:[~2010-11-03 18:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-03 18:25 Matthew Khouzam [this message]
2010-11-03 18:25 ` Matthew Khouzam
2010-11-03 18:25 ` Matthew Khouzam
2010-11-25 15:06 ` Mathieu Desnoyers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CD1A906.4000307@ericsson.com \
--to=matthew.khouzam@ericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox