mirror of
https://github.com/neovim/neovim.git
synced 2025-10-22 17:11:49 +00:00
memory: Add free wrapper and refactor project to use it
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.
This commit is contained in:
@@ -55,7 +55,7 @@ int main() {
|
||||
|
||||
#define kvec_t(type) struct { size_t size, capacity; type *items; }
|
||||
#define kv_init(v) ((v).size = (v).capacity = 0, (v).items = 0)
|
||||
#define kv_destroy(v) free((v).items)
|
||||
#define kv_destroy(v) xfree((v).items)
|
||||
#define kv_A(v, i) ((v).items[(i)])
|
||||
#define kv_pop(v) ((v).items[--(v).size])
|
||||
#define kv_size(v) ((v).size)
|
||||
|
||||
Reference in New Issue
Block a user