-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
Clarification on the Purpose of Red-Black Trees in Box64 #2039
Comments
While On the the other hand, having everything in the same map could make gatthering all needed information on a address space in less calls, but that would require some changes in the code. For now, everything is separate because it's easier to manipulate that way. |
I've noticed that the functions
However, I've observed that the size of a RB-tree node is too large that it cannot fit more than one node in a cache line, which makes it cache-unfriendly. Before proceeding, I would like to clarify the purpose of using Red-Black Trees in Box64. |
The main functionality of the red-black trees is to provide a fast, cheap way to map ranges of addresses to a number and acccessing by providing an address in this range. The only functionalities required are:
The mental model is:
The exact data structure itself is not really important. In fact, before the current implementation of red-black trees, it used to be (nested) arrays, but these were too memory expensive. (However, note that EDIT: Also, |
Thanks for your explanation. But I don't think the exact data structure is unimportant. To achieve this, I want to make the following modifications:
However, despite the aforementioned methods, the size of the node remains too large for the cache line. Could you please advise me on any strategies I can employ to reduce the size of the node? Additionally, what is the difference between a dynablock (native instruction block) and a block? Finally, I want to confirm whether the |
I have noticed that in
custommem.c
, memory ranges mapped by mmap are simultaneously recorded and removed in multiple red-black trees.Each node encapsulate a memory range along with detailed information about that range.
My question pertains to the necessity of using three distinct red-black tree nodes to record the same memory range.
Is this approach taken solely to maintain three separate pieces of information related to each memory range?
If that's the case, could a bitwise operation be implemented to consolidate the information, potentially reducing the number of trees required?
The text was updated successfully, but these errors were encountered: