OceanBase Plugin Development Kit
OceanBase Plugin Development Kit
载入中...
搜索中...
未找到
ob_plugin_allocator.h
浏览该文件的文档.
1/*
2 * Copyright (c) 2023 OceanBase
3 * OceanBase is licensed under Mulan PubL v2.
4 * You can use this software according to the terms and conditions of the Mulan PubL v2.
5 * You may obtain a copy of Mulan PubL v2 at:
6 * http://license.coscl.org.cn/MulanPubL-2.0
7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10 * See the Mulan PubL v2 for more details.
11 */
12
13#pragma once
14
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
28
30OBP_PUBLIC_API void *obp_malloc(int64_t size);
31
33OBP_PUBLIC_API void *obp_malloc_align(int64_t alignment, int64_t size);
34
36OBP_PUBLIC_API void obp_free(void *ptr);
37
43OBP_PUBLIC_API void *obp_allocate(ObPluginAllocatorPtr allocator, int64_t size);
44
46OBP_PUBLIC_API void *obp_allocate_align(ObPluginAllocatorPtr allocator, int64_t alignment, int64_t size);
47
50
53#ifdef __cplusplus
54} // extern "C"
55#endif
ObPluginDatum ObPluginAllocatorPtr
< The allocator paramter
OBP_PUBLIC_API void * obp_malloc(int64_t size)
malloc interface with alignment
OBP_PUBLIC_API void obp_free(void *ptr)
OBP_PUBLIC_API void obp_deallocate(ObPluginAllocatorPtr allocator, void *ptr)
OBP_PUBLIC_API void * obp_allocate(ObPluginAllocatorPtr allocator, int64_t size)
allocate memory with the specific allocator
OBP_PUBLIC_API void * obp_malloc_align(int64_t alignment, int64_t size)
free memory
OBP_PUBLIC_API void * obp_allocate_align(ObPluginAllocatorPtr allocator, int64_t alignment, int64_t size)
free memory
#define OBP_PUBLIC_API
void * ObPluginDatum
Used for param type