MiniOB
1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
src
memtracer
common.h
1
/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2
miniob is licensed under Mulan PSL v2.
3
You can use this software according to the terms and conditions of the Mulan PSL v2.
4
You may obtain a copy of Mulan PSL v2 at:
5
http://license.coscl.org.cn/MulanPSL2
6
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9
See the Mulan PSL v2 for more details. */
10
11
#pragma once
12
13
#include <stdio.h>
14
15
namespace
memtracer {
16
#define mt_visible __attribute__((visibility("default"
)))
17
18
using
malloc_func_t =
void
*(*)(
size_t
);
19
using
free_func_t = void (*)(
void
*);
20
using
mmap_func_t =
void
*(*)(
void
*,
size_t
,
int
,
int
,
int
, off_t);
21
using
munmap_func_t = int (*)(
void
*, size_t);
22
23
void
log_stderr(
const
char
*format, ...);
24
25
#define MEMTRACER_LOG(format, ...) \
26
do { \
27
fprintf(stderr, "[MEMTRACER] "
); \
28
log_stderr(format, ##__VA_ARGS__); \
29
} while (0)
30
31
}
// namespace memtracer
制作者
1.9.5