| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
- Add channel module that exposes the API over arbitrary streams
- Add `xmemdup` for duplicating memory chunks
- Make job exit callback optional
|
| |
|
| |
|
|
|
|
|
|
| |
Problem EMSGN was being used to print a format string using "%lu",
which is incorrect because EMSGN casts its argument to int64_t.
Solution Use EMGSU instead.
|
|
|
|
|
| |
Both are implemented to POSIX 2008 spec, though I'm not sure I'm happy about
stpncpy's behaviour.
|
|
|
|
|
| |
Use `xcalloc` instead.
Inline `alloc_tv` and `alloc_string_tv` in eval.c
|
|
|
|
|
|
|
|
|
|
|
| |
There will be more use cases for try_malloc(): see #556.
- Reimplemented xmalloc() using try_malloc().
- verbose_try_malloc() is just like try_malloc() but shows an out-of-memory
error message before returning NULL.
- Let the compiler generate size>>1 assembly for signed types. We're not using
old compilers here.
- Add proper function attributes to the new functions in memory.h
|
|
|
|
|
|
|
|
| |
Unfortunately there's still a case where NULL can be returned from
file_pat_to_reg_pat().
xmemdupz() and xmallocz() aren't static anymore. There are many use cases for
these function.
|
|
|
|
|
|
| |
Fix uses of plain "%lu" within EMSGN():
- Replace "%lu" with "%" PRIu64.
- No argument cast needed. EMSGN() will take care of that.
|
|
|
|
|
| |
Use `xcalloc` instead. Change some local variables
to avoid casting.
|
|
|
|
|
|
|
|
|
|
|
| |
`alloc_check` is just a wrapper around xmalloc, so we can remove it and use
xmalloc directly. ref #487 / #488
The call was replaced in the following files:
- ex_cmds.c
- misc1.c
- ops.c
|
| |
|
|
|
|
| |
Bonus: implement lalloc_clear and alloc_clear using xcalloc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By simpler cases I mean cases where the OOM error is not expected to be handled
by the caller of the function that calls `alloc`, `lalloc`, `xrealloc`,
`xmalloc`, `alloc_clear`, and `lalloc_clear`.
These are the functions that:
- Do not return an allocated buffer
- Have OOM as the only error condition
I took note of the functions that expect the caller to handle the OOM error and
will go through them to check all the callers that may be handling OOM error in
future commits.
I'm ignoring eval.c and ex_.c in this series of commits. eval.c will soon be
obsolete and I will deal with ex_.c in later PRs.
|
|
|
|
|
| |
Utility functions for copying strings to newly-allocated chunks. They either
succeed or exit the program.
|
|
|