aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memory.c
Commit message (Collapse)AuthorAge
...
* 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
* Remove unnecessary includes for errno.hRui Abreu Ferreira2015-11-25
|
* memory.c: Prevent garbage collection when running out of memory.oni-link2015-11-13
| | | | | | | | | | When running out of memory, garbage collection would free lists and dictionaries that are not yet referenced. This would later on lead to a use-after-free for these objects. Releated to vim-patch:7.4.916, so also updating version.c. Patch by @ZyX-I
* shada: Refactor file reading/writing to use os_openZyX2015-10-08
|
* Remove instances of TRUE/FALSE macroSteven Oliver2015-09-04
| | | | | | memory.c os_unix.c path.c
* Remove char_u: ex_docmd:do_cmdline_cmd()Michael Reed2015-05-13
|
* jemalloc: Force use of prefixed functions.Florian Walch2015-04-29
| | | | | | | | * Set JEMALLOC_NO_DEMANGLE to be able to use `je_*` functions, regardless of how jemalloc was compiled (--with-jemalloc-prefix) * Show jemalloc information in Neovim's version output. Resolve #2449.
* deps: Add jemalloc as an optional dependencyThiago de Arruda2015-04-13
| | | | | | | | | | | | Jemalloc will be used if the cmake option `USE_JEMALLOC` is enabled(which is the default). To avoid trouble with clang's ASAN, it is disabled by default if the `SANITIZE` option is enabled. Since jemalloc has thread cache for small objects, it fills the gap created by removing klib memory pools. The `xstrdup` funciton(memory.c) had to be reimplemented on top of `xmalloc` to make it work with a custom allocator.
* memory: Add `free` wrapper and refactor project to use itThiago de Arruda2015-04-13
| | | | | | We already use wrappers for allocation, the new `xfree` function is the equivalent for deallocation and provides a way to fully replace the malloc implementation used by Neovim.
* misc2.c: Move emsg* functions to message.c #2152Michael Reed2015-03-19
| | | | Clean up said functions and some outdated comments while we're at it.
* refactor: Remove term modules and termcap optionsThiago de Arruda2015-02-21
| | | | | | | | | | | | | | | - Removed term.c, term.h and term_defs.h - Tests for T_* values were removed. screen.c was simplified as a consequence(the best strategy for drawing is implemented in the UI layer) - Redraw functions now call ui.c functions directly. Updates are flushed with `ui_flush()` - Removed all termcap options(they now return empty strings for compatibility) - &term/&ttybuiltin options return a constant value(nvim) - &t_Co is still available, but it mirrors t_colors directly - Remove cursor tracking from screen.c and the `screen_start` function. Now the UI is expected to maintain cursor state across any call, and reset it when resized. - Remove unused code
* vim-patch:7.4.446Pavel Platto2015-01-20
| | | | | | | | | Problem: In some situations, when setting up an environment to trigger an autocommand, the environment is not properly restored. Solution: Check the return value of switch_win() and call restore_win() always. (Daniel Hahler) https://code.google.com/p/vim/source/detail?r=v7-4-446
* Macro cleanup: PROTOMichael Reed2015-01-14
| | | | | | Regarding dict_lookup() in eval.c: both definitions are the same, the only difference being the spacing between the indirection operator and the indentation level.
* strcnt: remove unused parameterJustin M. Keyes2014-12-12
|
* memory: memcnt and strcnt.Scott Prager2014-12-11
|
* Merge pull request #1497 from splinterofchaos/const-attrJustin M. Keyes2014-11-29
|\ | | | | constify and func-attribute memory.c and strings.c
| * strings/memory: constify and func_attr.Scott Prager2014-11-27
| | | | | | | | Fix MB_COPY_cHAR() to accept const pointers.
* | ui: Remove redundant ui.h includesThiago de Arruda2014-11-27
|/ | | | Also move read_error_exit to os/input.c
* Fix substitute newline: Memory functions: Improve style.Eliseo Martínez2014-11-24
| | | | | | | | `try_malloc` was changed in 8bb2c2c0742c57150655e18cf8418a758cebdce8 to avoid a warning when size is 0. Then, this improves some things on that: - Use local vars instead of changing parameters. - Homogenize style for other related functions.
* Merge pull request #1439 from jszakmeister/shuffle-some-includesJustin M. Keyes2014-11-11
|\ | | | | Move many includes down to the EXITFREE block.
| * Move many includes down to the EXITFREE block.John Szakmeister2014-11-09
| | | | | | | | | | | | | | They're unnecessary for the rest of the file, and they're only there at all to help implement `free_all_mem` for use with Clang's Address Sanitizer. So let's move them to avoid any confusion about why they are there.
* | Fix warnings: memory.c: xcalloc(): 0 size calloc: CW.Eliseo Martínez2014-11-11
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Problem : Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131) @ 148. Diagnostic : Cautionary warning. Rationale : Reported circumstance (calling calloc with requesting 0 size allocation) can occur, and it's not an issue. It's perfectly legal doing so, though result is implementation dependant. A given implementation can return NULL or a valid pointer, so that free() can be called on it later the same as if it was a real pointer. Such a pointer should not be dereferenced, though. Now, for some reason I can't explain, compiler is warning us in the case of calloc, but not in the case of malloc, which is doing the same. Resolution : Refactor memory functions to avoid using implementation dependant behaviour. Proposed code is neater to read, and it avoids calling system memory functions with size 0, thus behaving the same everywhere. Note that semantics for xmalloc/xcalloc is slightly changed: - Previously, an implementation that returns a valid pointer on malloc/calloc with 0 size, would return that pointer to xmalloc/xcalloc caller. - Currently, a regular pointer is always returned.
* memory: implement xmemrchr()Scott Prager2014-11-07
|
* memory: memchrsub and strchrsubScott Prager2014-09-30
|
* memory: xstrchrnul and xmemscan.Scott Prager2014-09-30
|
* FOR_ALL_WINDOWS_IN_TAB and local variables in FOR_ALL_TAB_WINDOWSWayne Rowcliffe2014-09-22
|
* memory: Use i18n messages for memory-related errorsThiago de Arruda2014-09-12
|
* Statically allocate NameBuffWayne Rowcliffe2014-07-22
|
* Use strict function prototypes #945Pavel Platto2014-07-14
| | | | | | | | | | | | | | | | | | | `-Wstrict-prototypes` warn if a function is declared or defined without specifying the argument types. This warning disallow function prototypes with empty parameter list. In C, a function declared with an empty parameter list accepts an arbitrary number of arguments when being called. This is for historic reasons; originally, C functions didn't have prototypes, as C evolved from B, a typeless language. When prototypes were added, the original typeless declarations were left in the language for backwards compatibility. Instead we should provide `void` in argument list to state that function doesn't have arguments. Also this warning disallow declaring type of the parameters after the parentheses because Neovim header generator produce no declarations for old-stlyle prototypes: it expects to find `{` after prototype.
* move errno.h include out of vim.hBrandon Coleman2014-07-09
|
* move <inttypes.h> include out of vim.hBrandon Coleman2014-07-09
|
* remove stdbool.h include from vim.h and globals.hBrandon Coleman2014-07-09
|
* Replace int with bool in some files. #654Klemen Košir2014-07-08
|
* Replace vim_strncpy calls: add STRLCPYDouglas Schneider2014-06-13
|
* Add function attributes to functions in memory.h #811Wesley Wiser2014-06-10
| | | | Add missing function attributes in memory.h. Fixes #806
* 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.
* Merge #708 'Remove NULL/non-NULL tests after vim_str(n)save'Justin M. Keyes2014-05-22
|\ | | | | | | - replace alloc with xmalloc
| * Replace alloc() with xmalloc() and remove immediate OOM checksFelipe Oliveira Carvalho2014-05-19
| |
| * Remove NULL/non-NULL tests after calls to vim_str(n)save()Felipe Oliveira Carvalho2014-05-19
| |
* | Remove cryptographyJohn Schmidt2014-05-20
|/ | | | | | | | | | | | | As discussed in #694, vim encryption uses old, obsolete algorithms that are poorly implemented. Since insecure cryptography is worse than no cryptgraphy, the community voted in favor of removing all crypto. Various alternatives to the old crypto is being discussed in #701. Closes #694.
* Fix `xmemdup` function signatureThiago de Arruda2014-05-17
|
* 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.