Say I have generic table defined by myself (https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ntddk/nf-ntddk-rtlinitializegenerictable) no matter this is AVL nor Splay.
Now, if my "content" of leaves in this tree contains some ULONGs or other simple POD style values I guess this is not a problem, but lets assume I have some strings in it. Is there any option to work on pointers to allocated memory instead of copying data every time I need to get some content?
I assume if I woudl return pointer to originally allocated memory (by allocate function I provided) it will be not thread safe right? Because I will never know if in another thread such content could be deleted... so i would need to have some ref counters to use otriginal memory OR I cna copy data all the time (but doing it under lock looks bit performance invasive). What is good way of handling this issue in general? how you address such issue?
Another question, more to confirm, if AVL tree needs rebalancing I guess under the hood there are no reallocations, but reassinging pointers "beloning" to tree right? I mean that AVL contains some structures and only those are "repinned" and memory allocated for content do not change?
It looks like you're new here. If you want to get involved, click one of these buttons!
|Upcoming OSR Seminars|
|Writing WDF Drivers||21 Oct 2019||OSR Seminar Space & ONLINE|
|Internals & Software Drivers||18 Nov 2019||Dulles, VA|
|Kernel Debugging||30 Mar 2020||OSR Seminar Space|
|Developing Minifilters||27 Apr 2020||OSR Seminar Space & ONLINE|