aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memory.h
Commit message (Collapse)AuthorAge
* refactor: move function macros out of vim_defs.h (#26300)zeertzjq2023-11-29
|
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* refactor: move Arena and ArenaMem to memory_defs.h (#26240)zeertzjq2023-11-27
|
* refactor: replace manual header guards with #pragma oncedundargoc2023-11-12
| | | | | It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard.
* build(lint): remove unnecessary clint.py rulesdundargoc2023-10-23
| | | | | Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py.
* build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
* build(lint): remove clint.py rules for braces #20880dundargoc2022-11-01
| | | | | Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also https://github.com/neovim/neovim/pull/18563
* fix(memory): fix memory alignment for dynamic allocationJan Palus2022-10-31
| | | | | | | | all pointers returned by arena_alloc residing in arena block should be properly aligned to meet neovim's alignment requirements but keeping it simple settle on ARENA_ALIGN = MAX(sizeof(void *), sizeof(double)).
* refactor(arena): use a shared block freelistbfredl2022-08-24
| | | | | This is both simpler in client code and more effective (always reuse block hottest in cache)
* perf(api): allow to use an arena for return valuesbfredl2022-08-23
|
* perf(ui): reduce allocation overhead when encoding "redraw" eventsbfredl2022-06-20
| | | | | | | | | | | | | | | | | Note for external UIs: Nvim can now emit multiple "redraw" event batches before a final "flush" event is received. To retain existing behavior, clients should make sure to update visible state at an explicit "flush" event, not just the end of a "redraw" batch of event. * Get rid of copy_object() blizzard in the auto-generated ui_event layer * Special case "grid_line" by encoding screen state directly to msgpack events with no intermediate API events. * Get rid of the arcane notion of referring to the screen as the "shell" * Array and Dictionary are kvec_t:s, so define them as such. * Allow kvec_t:s, such as Arrays and Dictionaries, to be allocated with a predetermined size within an arena. * Eliminate redundant capacity checking when filling such kvec_t:s with values.
* perf(memory): use an arena for RPC decodingbfredl2022-06-14
| | | | | | | | | drawback: tracing memory errors with ASAN is less accurate for arena allocated memory. Therefore, to start with it is being used for Object types around serialization/deserialization exclusively. This is going to have a large impact especially when TUI is refactored as a co-prosess as all UI events will be serialized and deserialized by nvim itself.
* refactor: format all C files under nvim/ #15977dundargoc2021-10-12
| | | | | | | | * refactor: format all C files under nvim * refactor: disable formatting for Vim-owned files: * src/nvim/indent_c.c * src/nvim/regexp.c * src/nvim/regexp_nfa.c * src/nvim/testdir/samples/memfile_test.c
* refactor: introduce XFREE_CLEAR()Justin M. Keyes2019-05-25
| | | | | | | | | | | | | | | Unfortunately we cannot indiscriminately replace xfree() with XFREE_CLEAR(), because comparing pointers after freeing them is a common pattern. Example in `tv_list_remove_items()`: xfree(li); if (li == item2) { break; } Instead we can do it selectively/explicitly. ref #1375
* unittest,memory: Fix testsZyX2017-01-07
|
* memory: Document new additions to memory.hZyX2017-01-07
|
* memory: Restore entered_free_all_mem functionalityZyX2017-01-07
|
* unittest: Allow mocking allocator callsZyX2017-01-07
|
* refactor: eliminate misc2.cJustin M. Keyes2016-09-13
| | | | | | | | | | move `call_shell` to misc1.c Move some fns to state.c Move some fns to option.c Move some fns to memline.c Move `vim_chdir*` fns to file_search.c Move some fns to new module, bytes.c Move some fns to fileio.c
* rbuffer: Reimplement as a ring buffer and decouple from rstreamThiago de Arruda2015-07-01
| | | | | | | | | | | | | | | | | | | | Extract the RBuffer class from rstream.c and reimplement it as a ring buffer, a more efficient version that doesn't need to relocate memory. The old rbuffer_read/rbuffer_write interfaces are kept for simple reading/writing, and the RBUFFER_UNTIL_{FULL,EMPTY} macros are introduced to hide wrapping logic when more control is required(such as passing the buffer pointer to a library function that writes directly to the pointer) Also add a basic infrastructure for writing helper C files that are only compiled in the unit test library, and use this to write unit tests for RBuffer which contains some macros that can't be accessed directly by luajit. Helped-by: oni-link <knil.ino@gmail.com> Reviewed-by: oni-link <knil.ino@gmail.com> Reviewed-by: Scott Prager <splinterofchaos@gmail.com> Reviewed-by: Justin M. Keyes <justinkz@gmail.com> Reviewed-by: Michael Reed <m.reed@mykolab.com>
* memory.h: don't include vim.h in header filesNicolas Hillegeer2014-07-16
| | | | | Also include stdint.h in khash.h. It was transitively included by vim.h via memory.h before. khash.h accidentally relied on that.
* Add automatic generation of headersZyX2014-06-02
| | | | | | | | | | | | | | | | | - The 'stripdecls.py' script replaces declarations in all headers by includes to generated headers. `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'` was used for this. - Add and integrate gendeclarations.lua into the build system to generate the required includes. - Add -Wno-unused-function - Made a bunch of old-style definitions ANSI This adds a requirement: all type and structure definitions must be present before INCLUDE_GENERATED_DECLARATIONS-protected include. Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is the only exception.
* Move documentation from function declarations to definitionsZyX2014-06-02
| | | | Uses a perl script to move it (scripts/movedocs.pl)
* memory: add xstrlcpyNicolas Hillegeer2014-05-26
| | | | | | Less "blow a hole in your foot" than strncpy. As also indicated by coverity. Implementation inspired by the linux kernel (very similar to OSX's Libc implementation as well).
* Remove long_u: do_outofmem_msg().Eliseo Martínez2014-05-24
| | | | | Remove long_u occurrences due to do_outofmem_msg() function. Refactor size parameter from long_u into size_t.
* Replace alloc() with xmalloc() and remove immediate OOM checksFelipe Oliveira Carvalho2014-05-19
|
* Removed `lalloc` prototype(again)Thiago de Arruda2014-05-17
| | | | It was re-added by accident when resolving merge conflicts
* Fix `xmemdup` function signatureThiago de Arruda2014-05-17
|
* Introduce nvim namespace: Fix define guards.Eliseo Martínez2014-05-15
| | | | | | Change define guards from NEOVIM_XXX_H to NVIM_XXX_H: - Change header files. - Change clint correct guard name calculation.
* Introduce nvim namespace: Fix project-local includes.Eliseo Martínez2014-05-15
| | | | Prepend 'nvim/' in all project-local (non-system) includes.
* Introduce nvim namespace: Move files.Eliseo Martínez2014-05-15
Move files from src/ to src/nvim/. - src/nvim/ becomes the new root dir for nvim executable sources. - src/libnvim/ is planned to become root dir of the neovim library.