Debian Codegraph @

components/libminchassis/gunit_harness/include/mock/psi_memory_v2_empty.cc

raw symbols SCIP
1 /* Copyright (c) 2023, 2026, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24 #include <stdio.h>
25 #include <chrono>
26 #include <condition_variable>
27 #include "mysql/components/component_implementation.h"
28 #include "mysql/components/service_implementation.h"
29 #include "mysql/components/services/psi_memory_service.h"
30
31 namespace psi_memory_v2_empty {
32
33 static void register_memory(const char *, PSI_memory_info *, int) { return; }
34
35 static PSI_memory_key memory_alloc(PSI_memory_key, size_t,
36 struct PSI_thread **owner) {
37 *owner = nullptr;
38 return PSI_NOT_INSTRUMENTED;
39 }
40
41 static PSI_memory_key memory_realloc(PSI_memory_key, size_t, size_t,
42 struct PSI_thread **owner) {
43 *owner = nullptr;
44 return PSI_NOT_INSTRUMENTED;
45 }
46
47 static PSI_memory_key memory_claim(PSI_memory_key, size_t,
48 struct PSI_thread **owner, bool) {
49 *owner = nullptr;
50 return PSI_NOT_INSTRUMENTED;
51 }
52
53 static void memory_free(PSI_memory_key, size_t, struct PSI_thread *) { return; }
54
55 } // namespace psi_memory_v2_empty
56
57 BEGIN_SERVICE_IMPLEMENTATION(HARNESS_COMPONENT_NAME, psi_memory_v2)
58 psi_memory_v2_empty::register_memory, psi_memory_v2_empty::memory_alloc,
59 psi_memory_v2_empty::memory_realloc, psi_memory_v2_empty::memory_claim,
60 psi_memory_v2_empty::memory_free, END_SERVICE_IMPLEMENTATION();