-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird memset argument in RangeIPLookup::flush_table() #39
Comments
An interesting question. Here's what I think: The expand() function overwrites the entire contents of _range_base, _range_t, and _range_len, on EVERY route update. In the configure() path we call flush_table(), but then in initialize() call expand(). So..........hmm. (1) I would really not use RangeIPLookup if I were you. RadixIPLookup is much better (fast but small memory usage). If you are having problems with Radix, let me know; some students of mine have made good progress on improving its performance. (2) You are right that when flush_table() is called from flush_handler, it should memset() the ENTIRE table to 0 -- the last of your 3 variants. (3) It is correct, but expensive, to do that memset() during configure() as well. (4) In the longer term doing an expand() after every routing table update is silly, we should expand after a group of updates if possible. (5) But still, better to go with Radix. Make sense? |
Yep. I'm not using the element anyway, clang complained at me during compilation. |
Go clang! |
In elements/ip/rangeiplookup.cc, it says
Since those members are pointers, memset is clearing something the size of the pointer, not an element in the underlying array. Is this the intention? or should the code be
or
The text was updated successfully, but these errors were encountered: