summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/cli.c83
-rw-r--r--src/vlib/threads.c16
2 files changed, 2 insertions, 97 deletions
diff --git a/src/vlib/cli.c b/src/vlib/cli.c
index 85049884db6..d14ea683fb9 100644
--- a/src/vlib/cli.c
+++ b/src/vlib/cli.c
@@ -805,22 +805,6 @@ show_memory_usage (vlib_main_t * vm,
}
-#if USE_DLMALLOC == 0
- /* *INDENT-OFF* */
- foreach_vlib_main (
- ({
- mheap_t *h = mheap_header (clib_per_cpu_mheaps[index]);
- vlib_cli_output (vm, "%sThread %d %s\n", index ? "\n":"", index,
- vlib_worker_threads[index].name);
- vlib_cli_output (vm, " %U\n", format_page_map, pointer_to_uword (h) -
- h->vm_alloc_offset_from_header,
- h->vm_alloc_size);
- vlib_cli_output (vm, " %U\n", format_mheap, clib_per_cpu_mheaps[index],
- verbose);
- index++;
- }));
- /* *INDENT-ON* */
-#else
{
if (main_heap)
{
@@ -880,7 +864,6 @@ show_memory_usage (vlib_main_t * vm,
}
}
}
-#endif /* USE_DLMALLOC */
return 0;
}
@@ -1040,72 +1023,6 @@ VLIB_CLI_COMMAND (enable_disable_memory_trace_command, static) = {
};
/* *INDENT-ON* */
-
-static clib_error_t *
-test_heap_validate (vlib_main_t * vm, unformat_input_t * input,
- vlib_cli_command_t * cmd)
-{
-#if USE_DLMALLOC == 0
- clib_error_t *error = 0;
- void *heap;
- mheap_t *mheap;
-
- if (unformat (input, "on"))
- {
- /* *INDENT-OFF* */
- foreach_vlib_main({
- heap = clib_per_cpu_mheaps[this_vlib_main->thread_index];
- mheap = mheap_header(heap);
- mheap->flags |= MHEAP_FLAG_VALIDATE;
- // Turn off small object cache because it delays detection of errors
- mheap->flags &= ~MHEAP_FLAG_SMALL_OBJECT_CACHE;
- });
- /* *INDENT-ON* */
-
- }
- else if (unformat (input, "off"))
- {
- /* *INDENT-OFF* */
- foreach_vlib_main({
- heap = clib_per_cpu_mheaps[this_vlib_main->thread_index];
- mheap = mheap_header(heap);
- mheap->flags &= ~MHEAP_FLAG_VALIDATE;
- mheap->flags |= MHEAP_FLAG_SMALL_OBJECT_CACHE;
- });
- /* *INDENT-ON* */
- }
- else if (unformat (input, "now"))
- {
- /* *INDENT-OFF* */
- foreach_vlib_main({
- heap = clib_per_cpu_mheaps[this_vlib_main->thread_index];
- mheap = mheap_header(heap);
- mheap_validate(heap);
- });
- /* *INDENT-ON* */
- vlib_cli_output (vm, "heap validation complete");
-
- }
- else
- {
- return clib_error_return (0, "unknown input `%U'",
- format_unformat_error, input);
- }
-
- return error;
-#else
- return clib_error_return (0, "unimplemented...");
-#endif /* USE_DLMALLOC */
-}
-
-/* *INDENT-OFF* */
-VLIB_CLI_COMMAND (cmd_test_heap_validate,static) = {
- .path = "test heap-validate",
- .short_help = "<on/off/now> validate heap on future allocs/frees or right now",
- .function = test_heap_validate,
-};
-/* *INDENT-ON* */
-
static clib_error_t *
restart_cmd_fn (vlib_main_t * vm, unformat_input_t * input,
vlib_cli_command_t * cmd)
diff --git a/src/vlib/threads.c b/src/vlib/threads.c
index b2a2f6939e6..1ce4dc15613 100644
--- a/src/vlib/threads.c
+++ b/src/vlib/threads.c
@@ -742,15 +742,8 @@ start_workers (vlib_main_t * vm)
vec_add2 (vlib_worker_threads, w, 1);
/* Currently unused, may not really work */
if (tr->mheap_size)
- {
-#if USE_DLMALLOC == 0
- w->thread_mheap =
- mheap_alloc (0 /* use VM */ , tr->mheap_size);
-#else
- w->thread_mheap = create_mspace (tr->mheap_size,
- 0 /* unlocked */ );
-#endif
- }
+ w->thread_mheap = create_mspace (tr->mheap_size,
+ 0 /* unlocked */ );
else
w->thread_mheap = main_heap;
@@ -914,13 +907,8 @@ start_workers (vlib_main_t * vm)
vec_add2 (vlib_worker_threads, w, 1);
if (tr->mheap_size)
{
-#if USE_DLMALLOC == 0
- w->thread_mheap =
- mheap_alloc (0 /* use VM */ , tr->mheap_size);
-#else
w->thread_mheap =
create_mspace (tr->mheap_size, 0 /* locked */ );
-#endif
}
else
w->thread_mheap = main_heap;