|
| 1 | +// Copyright Materialize, Inc. and contributors. All rights reserved. |
| 2 | +// |
| 3 | +// Use of this software is governed by the Business Source License |
| 4 | +// included in the LICENSE file. |
| 5 | +// |
| 6 | +// As of the Change Date specified in that file, in accordance with |
| 7 | +// the Business Source License, use of this software will be governed |
| 8 | +// by the Apache License, Version 2.0. |
| 9 | + |
| 10 | +// BEGIN LINT CONFIG |
| 11 | +// DO NOT EDIT. Automatically generated by bin/gen-lints. |
| 12 | +// Have complaints about the noise? See the note in misc/python/materialize/cli/gen-lints.py first. |
| 13 | +#![allow(clippy::style)] |
| 14 | +#![allow(clippy::complexity)] |
| 15 | +#![allow(clippy::large_enum_variant)] |
| 16 | +#![allow(clippy::mutable_key_type)] |
| 17 | +#![allow(clippy::stable_sort_primitive)] |
| 18 | +#![allow(clippy::map_entry)] |
| 19 | +#![allow(clippy::box_default)] |
| 20 | +#![warn(clippy::bool_comparison)] |
| 21 | +#![warn(clippy::clone_on_ref_ptr)] |
| 22 | +#![warn(clippy::no_effect)] |
| 23 | +#![warn(clippy::unnecessary_unwrap)] |
| 24 | +#![warn(clippy::dbg_macro)] |
| 25 | +#![warn(clippy::todo)] |
| 26 | +#![warn(clippy::wildcard_dependencies)] |
| 27 | +#![warn(clippy::zero_prefixed_literal)] |
| 28 | +#![warn(clippy::borrowed_box)] |
| 29 | +#![warn(clippy::deref_addrof)] |
| 30 | +#![warn(clippy::double_must_use)] |
| 31 | +#![warn(clippy::double_parens)] |
| 32 | +#![warn(clippy::extra_unused_lifetimes)] |
| 33 | +#![warn(clippy::needless_borrow)] |
| 34 | +#![warn(clippy::needless_question_mark)] |
| 35 | +#![warn(clippy::needless_return)] |
| 36 | +#![warn(clippy::redundant_pattern)] |
| 37 | +#![warn(clippy::redundant_slicing)] |
| 38 | +#![warn(clippy::redundant_static_lifetimes)] |
| 39 | +#![warn(clippy::single_component_path_imports)] |
| 40 | +#![warn(clippy::unnecessary_cast)] |
| 41 | +#![warn(clippy::useless_asref)] |
| 42 | +#![warn(clippy::useless_conversion)] |
| 43 | +#![warn(clippy::builtin_type_shadow)] |
| 44 | +#![warn(clippy::duplicate_underscore_argument)] |
| 45 | +#![warn(clippy::double_neg)] |
| 46 | +#![warn(clippy::unnecessary_mut_passed)] |
| 47 | +#![warn(clippy::wildcard_in_or_patterns)] |
| 48 | +#![warn(clippy::collapsible_if)] |
| 49 | +#![warn(clippy::collapsible_else_if)] |
| 50 | +#![warn(clippy::crosspointer_transmute)] |
| 51 | +#![warn(clippy::excessive_precision)] |
| 52 | +#![warn(clippy::overflow_check_conditional)] |
| 53 | +#![warn(clippy::as_conversions)] |
| 54 | +#![warn(clippy::match_overlapping_arm)] |
| 55 | +#![warn(clippy::zero_divided_by_zero)] |
| 56 | +#![warn(clippy::must_use_unit)] |
| 57 | +#![warn(clippy::suspicious_assignment_formatting)] |
| 58 | +#![warn(clippy::suspicious_else_formatting)] |
| 59 | +#![warn(clippy::suspicious_unary_op_formatting)] |
| 60 | +#![warn(clippy::mut_mutex_lock)] |
| 61 | +#![warn(clippy::print_literal)] |
| 62 | +#![warn(clippy::same_item_push)] |
| 63 | +#![warn(clippy::useless_format)] |
| 64 | +#![warn(clippy::write_literal)] |
| 65 | +#![warn(clippy::redundant_closure)] |
| 66 | +#![warn(clippy::redundant_closure_call)] |
| 67 | +#![warn(clippy::unnecessary_lazy_evaluations)] |
| 68 | +#![warn(clippy::partialeq_ne_impl)] |
| 69 | +#![warn(clippy::redundant_field_names)] |
| 70 | +#![warn(clippy::transmutes_expressible_as_ptr_casts)] |
| 71 | +#![warn(clippy::unused_async)] |
| 72 | +#![warn(clippy::disallowed_methods)] |
| 73 | +#![warn(clippy::disallowed_macros)] |
| 74 | +#![warn(clippy::from_over_into)] |
| 75 | +// END LINT CONFIG |
| 76 | + |
| 77 | +use mz_ore::metrics::MetricsRegistry; |
| 78 | + |
| 79 | +#[cfg(all(not(target_os = "macos"), feature = "jemalloc"))] |
| 80 | +#[global_allocator] |
| 81 | +static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; |
| 82 | + |
| 83 | +/// Registers metrics for the global allocator into the provided registry. |
| 84 | +/// |
| 85 | +/// What metrics are registered varies by platform. Not all platforms use |
| 86 | +/// allocators that support metrics. |
| 87 | +#[cfg(any(target_os = "macos", not(feature = "jemalloc")))] |
| 88 | +#[allow(clippy::unused_async)] |
| 89 | +pub async fn register_metrics_into(_: &MetricsRegistry) { |
| 90 | + // No-op on platforms that don't use jemalloc. |
| 91 | +} |
| 92 | + |
| 93 | +/// Registers metrics for the global allocator into the provided registry. |
| 94 | +/// |
| 95 | +/// What metrics are registered varies by platform. Not all platforms use |
| 96 | +/// allocators that support metrics. |
| 97 | +#[cfg(all(not(target_os = "macos"), feature = "jemalloc"))] |
| 98 | +pub async fn register_metrics_into(registry: &MetricsRegistry) { |
| 99 | + mz_prof::jemalloc::JemallocMetrics::register_into(registry).await; |
| 100 | +} |
0 commit comments