aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/shada.c
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'upstream/master' into mix_20240309HEADrahmJosh Rahm2025-02-05
|\
| * refactor: iwyu #31637Justin M. Keyes2024-12-23
| | | | | | Result of `make iwyu` (after some "fixups").
* | Merge remote-tracking branch 'upstream/master' into mix_20240309Josh Rahm2024-11-25
|\|
| * vim-patch:9.1.0824: too many strlen() calls in register.c (#31022)zeertzjq2024-11-01
| | | | | | | | | | | | | | | | | | | | | | Problem: too many strlen() calls in register.c Solution: refactor code, add string_T struct to keep track of string lengths (John Marriott) closes: vim/vim#15952 https://github.com/vim/vim/commit/79f6ffd388299ef3b1c95cbe658785e6e66df144 Co-authored-by: John Marriott <basilisk@internode.on.net>
| * vim-patch:9.1.0798: too many strlen() calls in cmdhist.c (#30895)zeertzjq2024-10-22
| | | | | | | | | | | | | | | | | | | | | | Problem: too many strlen() calls in cmdhist.c Solution: refactor code and remove strlen() calls (John Marriott) closes: vim/vim#15888 https://github.com/vim/vim/commit/8df07d0ca310a55e1540f7d234b536abee49abd4 Co-authored-by: John Marriott <basilisk@internode.on.net>
* | Merge remote-tracking branch 'upstream/master' into mix_20240309Josh Rahm2024-11-19
|\|
| * fix(coverity/510436): shada_read_when_writing index out of bounds (#30686)Devon Gardner2024-10-06
| | | | | | | | | | | | | | | | Problem: Index for global and numbered marks out of bounds when indexing into numbered marks array (contains 10 elements but indexed by values 26 through 35. Solution: Offset index by number of global marks to correctly index numbered marks array.
| * fix(coverity/497355): shada_read_when_writing out of bounds read #30665Devon Gardner2024-10-05
| | | | | | | | | | | | | | | | | | | | Problem: There appears to be an intentional array out of bounds read when indexing global and numbered marks since they are adjacent in the struct that holds them. Solution: Explicitly index numeric marks array to avoid reading out of bounds from global marks array.
| * refactor(api)!: rename Dictionary => DictJustin M. Keyes2024-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the api_info() output: :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val') ... {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1} The `ArrayOf(Integer, 2)` return type didn't break clients when we added it, which is evidence that clients don't use the `return_type` field, thus renaming Dictionary => Dict in api_info() is not (in practice) a breaking change.
| * build(deps): remove msgpack-c dependencybfredl2024-08-05
| |
| * refactor(shada): rework msgpack decoding without msgpack-cbfredl2024-08-05
| | | | | | | | | | | | | | This also makes shada reading slightly faster due to avoiding some copying and allocation. Use keysets to drive decoding of msgpack maps for shada entries.
| * refactor(shada): don't use msgpack_packer for shadabfredl2024-06-27
| | | | | | | | | | Now msgpack-c is never used for packing. The real fun part will be replacing it for unpacking.
| * refactor(typval): don't use msgpack_packer for msgpackdump()bfredl2024-06-24
| | | | | | | | Step towords completely eliminating msgpack_packer.
| * refactor(shada): use msgpack_sbuffer lessbfredl2024-06-11
| | | | | | | | | | | | | | Work towards getting rid of libmsgpack depedency eventually. msgpack_sbuffer is just a string buffer, we can use our own String type.
| * refactor: move shared messages to errors.h #26214Justin M. Keyes2024-06-01
| |
| * refactor(shada): remove ShaDaReadDef secondary wrapperbfredl2024-05-28
| | | | | | | | | | | | `FileDescriptor` is already a wrapper around an fd and a buffer. By allowing to just use the buffer without an fd, it can already handle in-memory reads.
* | Merge remote-tracking branch 'upstream/master' into mix_20240309Josh Rahm2024-05-24
|\|
| * fix(shada): restore search pattern length properly (#28929)zeertzjq2024-05-23
| |
* | Merge remote-tracking branch 'upstream/master' into userregJosh Rahm2024-03-09
|\|
| * refactor(msgpack): allow flushing buffer while packing msgpackbfredl2024-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we needed to always pack an entire msgpack_rpc Object to a continous memory buffer before sending it out to a channel. But this is generally wasteful. it is better to just flush whatever is in the buffer and then continue packing to a new buffer. This is also done for the UI event packer where there are some extra logic to "finish" of an existing batch of nevents/ncalls. This doesn't really stop us from flushing the buffer, just that we need to update the state machine accordingly so the next call to prepare_call() always will start with a new event (even though the buffer might contain overflow data from a large event).
| * refactor(shada): devirtualize writerbfredl2024-02-25
| | | | | | | | | | | | writer is only ever used with FileDescriptor. We already have separate code paths for serializing shada data into memory, see shada_encode_regs() and friends
| * refactor(fileio): remove API shell layer encouraging unnecessary allocationsbfredl2024-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Functions like file_open_new() and file_open_fd_new() which just is a wrapper around the real functions but with an extra xmalloc/xfree around is an anti-pattern. If the caller really needs to allocate a FileDescriptor as a heap object, it can do that directly. FileDescriptor by itself is pretty much a pointer, or rather two: the OS fd index and a pointer to a buffer. So most of the time an extra pointer layer is just wasteful. In the case of scriptin[curscript] in getchar.c, curscript used to mean in practice: N+1 open scripts when curscript>0 zero or one open scripts when curscript==0 Which means scriptin[0] had to be compared to NULL to disambiguate the curscript=0 case. Instead, use curscript==-1 to mean that are no script, then all pointer comparisons dissappear and we can just use an array of structs without extra pointers.
| * refactor(api): use arena for metadata; msgpack_rpc_to_object delenda estbfredl2024-02-18
| | | | | | | | | | | | Note: kSDItemHeader is something is _written_ by nvim in the shada file to identify it for debugging purposes outside of nvim. But this data wasn't ever used by neovim after reading the file back, So I removed the parsing of it for now.
| * refactor: don't use subtraction in qsort() comparison functionszeertzjq2024-02-10
| |
| * refactor(IWYU): fix headersdundargoc2024-01-11
| | | | | | | | | | | | Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want.
| * refactor: remove redundant struct namesdundargoc2024-01-02
| | | | | | | | A struct can be anonymous if only its typedef is used.
| * refactor: remove redundant NOLINT commentsdundargoc2024-01-01
| |
| * refactor: follow style guidedundargoc2023-12-30
| |
| * refactor(IWYU): move evalarg_T to eval_defs.h (#26716)zeertzjq2023-12-23
| |
| * refactor: run IWYU on entire repodundargoc2023-12-21
| | | | | | | | Reference: https://github.com/neovim/neovim/issues/6371.
| * refactor: eliminate cyclic includesdundargoc2023-12-20
| |
| * vim-patch:8.1.1583: set_ref_in_list() only sets ref in items (#26418)zeertzjq2023-12-06
| | | | | | | | | | | | | | | | | | | | | | Problem: Set_ref_in_list() only sets ref in items. Solution: Rename to set_ref_in_list_items() to avoid confusion. https://github.com/vim/vim/commit/7be3ab25891fec711d8a2d9d242711a9155852b6 Omit set_ref_in_list() and set_ref_in_dict(): only used in popup window, if_pyth and if_lua. Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor(IWYU): fix includes for cmdhist.h (#26324)zeertzjq2023-11-30
| |
| * build: don't define FUNC_ATTR_* as empty in headers (#26317)zeertzjq2023-11-30
| | | | | | | | | | | | FUNC_ATTR_* should only be used in .c files with generated headers. Defining FUNC_ATTR_* as empty in headers causes misuses of them to be silently ignored. Instead don't define them by default, and only define them as empty after a .c file has included its generated header.
* | Merge remote-tracking branch 'upstream/master' into userreguserregJosh Rahm2023-11-29
|\|
| * refactor: fix headers with IWYUdundargoc2023-11-28
| |
| * build(IWYU): fix includes for undo_defs.hdundargoc2023-11-27
| |
| * build(IWYU): fix includes for func_attr.hdundargoc2023-11-27
| |
| * build(IWYU): replace most private mappings with pragmas (#26247)zeertzjq2023-11-27
| |
| * build: adjust clang-tidy warning exclusion logicdundargoc2023-11-20
| | | | | | | | | | | | | | Enable all clang-tidy warnings by default instead of disabling them. This ensures that we don't miss useful warnings on each clang-tidy version upgrade. A drawback of this is that it will force us to either fix or adjust the warnings as soon as possible.
| * refactor: enable formatting for ternariesdundargoc2023-11-20
| | | | | | | | | | | | This requires removing the "Inner expression should be aligned" rule from clint as it prevents essentially any formatting regarding ternary operators.
| * refactor: follow style guidedundargoc2023-11-19
| | | | | | | | | | - reduce variable scope - prefer initialization over declaration and assignment
| * build: remove PVSdundargoc2023-11-12
| | | | | | | | | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
| * refactor: the long goodbyedundargoc2023-11-05
| | | | | | | | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
| * build(lint): remove unnecessary clint.py rulesdundargoc2023-10-23
| | | | | | | | | | Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py.
| * refactor: move cmdline completion types to cmdexpand_defs.h (#25465)zeertzjq2023-10-02
| |
| * refactor: reorganize option header files (#25437)zeertzjq2023-09-30
| | | | | | | | | | | | - Move vimoption_T to option.h - option_defs.h is for option-related types - option_vars.h corresponds to Vim's option.h - option_defs.h and option_vars.h don't include each other
| * build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
| |
| * refactor(message): smsg_attr -> smsgbfredl2023-09-29
| |
| * refactor: remove longdundargoc2023-09-29
| | | | | | | | | | long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform.