aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-04-12 11:34:58 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-04-12 17:20:24 -0300
commitba10e311bddab18e38b1b706e232f804c2da9174 (patch)
treea4b66f731ff0c1a37a241b740a8e5465320d3a7a /src/nvim/eval.c
parent27b5ef3975e22c7d62e8dbe780dc75607e36eb43 (diff)
downloadrneovim-ba10e311bddab18e38b1b706e232f804c2da9174.tar.gz
rneovim-ba10e311bddab18e38b1b706e232f804c2da9174.tar.bz2
rneovim-ba10e311bddab18e38b1b706e232f804c2da9174.zip
memory: Replace klib memory pools by malloc/free
Klib pools were used to improve allocation efficiency for some small objects, but it is not a thread-safe approach. Thread safety in allocations will be required for implementing #2371).
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 7e020a9bce..67cef68b38 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -21,8 +21,6 @@
#include <math.h>
#include <limits.h>
-#include "nvim/lib/klist.h"
-
#include "nvim/assert.h"
#include "nvim/vim.h"
#include "nvim/ascii.h"
@@ -469,9 +467,6 @@ typedef struct {
list_T *received;
int status;
} JobEvent;
-#define JobEventFreer(x)
-KMEMPOOL_INIT(JobEventPool, JobEvent, JobEventFreer)
-static kmempool_t(JobEventPool) *job_event_pool = NULL;
static int disable_job_defer = 0;
/*
@@ -508,8 +503,6 @@ void eval_init(void)
set_vim_var_nr(VV_SEARCHFORWARD, 1L);
set_vim_var_nr(VV_HLSEARCH, 1L);
set_reg_var(0); /* default for v:register is not 0 but '"' */
-
- job_event_pool = kmp_init(JobEventPool);
}
#if defined(EXITFREE)
@@ -20149,7 +20142,7 @@ static inline bool is_user_job(Job *job)
static inline void push_job_event(Job *job, ufunc_T *callback,
const char *type, char *data, size_t count, int status)
{
- JobEvent *event_data = kmp_alloc(JobEventPool, job_event_pool);
+ JobEvent *event_data = xmalloc(sizeof(JobEvent));
event_data->received = NULL;
if (data) {
event_data->received = list_alloc();
@@ -20317,7 +20310,7 @@ end:
// exit event, safe to free job data now
term_job_data_decref(ev->data);
}
- kmp_free(JobEventPool, job_event_pool, ev);
+ free(ev);
}
static void script_host_eval(char *name, typval_T *argvars, typval_T *rettv)