[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] Incremental search
On Sun, Dec 17, 2017 at 01:39:33AM +0300, Azat Khuzhin wrote:
> > I should probably fully grasp the difference between .last_with_datap
> > and .last before trying to write a PoC.
>
> I guess you already looked at:
> https://github.com/libevent/libevent/blob/6e5c15d095d37036553d491b52d27fbbda08e7f2/evbuffer-internal.h#L99
Just now. Earlier I just skimmed through the code to find parts I would
have to look at if I were to implement a new search function.
The advance_last_with_data() function also gives some guidance.
I think that the last_with_datap comment needs some adjustments. It
states:
"The last_with_datap pointer points at _whatever 'next' pointer_
points at the last_with_datap chain."
There is probably a typo and it should be "last_with_data chain", not
"last_with_datap chain".
And I think it would be grammatically correct and clearer if it were:
"The last_with_datap pointer points at _whatever 'next' pointer_
pointing at the last_with_data chain."
BTW, I was also looking for (\*.*last_with_datap.*[^=]=[^=]) an
explanation for the pointer's indirectness and found only one occurrence
where .next of some chain is modified via that pointer:
PRESERVE_PINNED(): *src->last_with_datap = tmp;
All other cases seem to dereference .last_with_datap to a pointer to an
actual chain first.
--
Marcin Szewczyk
http://wodny.org
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.