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
[RFC] add kbtree_t and use it for bufhl #5266
Conversation
I want to start using the work here, how should i go about incorporating it into my pull request? should i cherry pick the commits ? That would produce the most straight forward commit history. Otherwise if this gets merged into master i can rebase? |
You can cherry-pick commits. Later when this is merged, and you rebase this, git will silently drop those commits and if it doesn't, you should be able to silently ignore the conflicts (as long as you don't add separate new changes to kb_tree.h) I hope to look into this again soon after the 0.1.6 release, first I need to focus on some api versioning work needed for/after 0.1.6 release. |
df0bcb7
to
0cf2d28
Compare
src/nvim/lib/kbtree.h
Outdated
@@ -0,0 +1,396 @@ | |||
#ifndef __AC_KBTREE_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, thanks. I will fix it in the next rebase. Fixed
Can we merge this? It's working well for me. We have a few todo such as kb_itr_interval but we can leave that for the future. I have added the license back in the extmarks branch so it will be included. |
This is still marked WIP and needs at least a rebase with the license change, plus an OK from @bfredl ... |
Sorry for the delay, I've been away from all development due to illness. This should be mostly done, I hope to fix the rebase and mark it ready "soon". |
sorry to hear about the illness, are you back on your feet now? we missed you buddy ^^ |
45143eb
to
41c3e0b
Compare
rebased and fixed some style issues and a memory leak. |
will i have to apply the same fix to extended marks? If so could you mark it. |
src/nvim/lib/kbtree.h
Outdated
|
||
/* The following is *DEPRECATED*!!! Use the iterator interface instead! */ | ||
|
||
#if 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, guess we should remove it, as we've refactored the library anyway.
@timeyyy in |
Would it be worth porting https://github.com/attractivechaos/klib/blob/master/test/kbtree_test.c to a lua unit test? |
That looks more like a benchmark than a unit test? |
@bfredl what do you mean by revived? did the error only happen after using |
50d63ff
to
36748da
Compare
Hmm, I have no changes in deps. Some hidden depenency on branch name, PR number or commit metadata? |
The recent upgrade of luarocks is most likely the reason. Cleared travis cache and restarted build. |
I had no idea Travis cached things indefinitely per PR... |
The failed travis build isn't related to this PR, it detected a loop_close hang. The QB failure also is known/unrelated. |
This feature is ready to merge? |
Let's make at least most of the travis builds pass again. (I given up the hope of seeing a green build anytime soon). |
The qb release build complains:
At least the first one is clearly wrong, which makes me suspect all are. Can |
could use a pragma, we're doing that in at least assert.h, I also temporarily used it here though that was later replaced. |
Compiles cleanly now everywhere. @justinmk Are you planning to release 0.2.1 soon-ish? Then maybe this should wait, would be best to be used a bit on master before shipped in a release. |
I think 0.2.1 is not soon... https://github.com/neovim/neovim/pulls?q=is%3Aopen+is%3Apr+milestone%3A0.2.1 |
@Shougo IIRC for "patch" level releases, they don't need to cover everything in a milestone, they just need to be a stable enough point with some new features/bug fixes. Rather the milestone will just be renamed to 0.2.2, which as you see don't exist yet. |
OK. |
When TUI settles down 0.2.1 is probably a good idea. Soon I hope. |
Sound that will take a while. Let's merge this, if tests passes once more... |
As discussed in #5031 this is a separate for PR to cleanup and integrate kbtree_t. Also use it for bufhl to get some coverage. Fixed compiler warnings (though the
const
warnings might have a better solution than removeconst
everywhere, I removed them for now as make output is impossible to parse otherwise), though remaining style issues.@timeyyy for extmark there is two things to note:
The "eliminate unneccesary heap allocation" commit does that. kbtree_t is a zero/calloc-initializable struct just like kvec_t. The changes for extmark is hopefully analogous to the bufhl changes in the same commit. (include the struct directly in buf_T, no explicit initialization needed, kbtree functions need an extra
&
)bufhl_mark_adjust shows a way to handle
:move
(only operation where marks can switch order, currently)