Modernization: Implement base data-structures and replace usage#540
Merged
Conversation
Member
Author
|
FYI, windows build failed due to whitespace issues in Makefile.inc that I'll fix. The darwin build issue I've researched extensively, it appears to be something related to some DNS server in Cirrus-CI not being able to handle large responses so it times out then returns a server failure. It all depends on which Cirrus-CI node you hit. At first I thought it was my issue, but that's how I uncovered some bugs in what response code c-ares was returning and this PR fixes that too. |
… ares__rand caches internally. add note in htable why we're not using ares__slist_t for chaining on collisions
Member
Author
|
@bagder don't suppose you can review today? If not, I'll probably just go ahead and merge it so I can start work on the tickets referenced in the description. I can't really imagine there's anything objectionable here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
c-ares currently lacks modern data structures that can make coding easier and more efficient. This PR implements a new linked list, skip list (sorted linked list), and hashtable implementation that are easy to use and hard to misuse. Though these implementations use more memory allocations than the prior implementation, the ability to more rapidly iterate on the codebase is a bigger win than any marginal performance difference (which is unlikely to be visible, modern systems are much more powerful than when c-ares was initially created).
The data structure implementation favors readability and audit-ability over performance, however using the algorithmically correct data type for the purpose should offset any perceived losses.
The primary motivation for this PR is to facilitate future implementation for Issues #444, #135, #458, and possibly #301
A couple additional notes: