patch 4.0

This commit is contained in:
wangzelin.wzl
2022-10-24 10:34:53 +08:00
parent 4ad6e00ec3
commit 93a1074b0c
10533 changed files with 2588271 additions and 2299373 deletions

View File

@ -19,17 +19,18 @@
#include "lib/oblog/ob_log.h"
#include "lib/allocator/ob_allocator.h"
using namespace oceanbase::common;
void* parser_alloc_buffer(void* malloc_pool, const int64_t alloc_size)
void *parser_alloc_buffer(void *malloc_pool, const int64_t alloc_size)
{
int ret = OB_SUCCESS;
void* alloced_buf = NULL;
void *alloced_buf = NULL;
if (OB_ISNULL(malloc_pool)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid malloc pool", K(ret));
} else {
ObIAllocator* allocator = static_cast<ObIAllocator*>(malloc_pool);
ObIAllocator *allocator = static_cast<ObIAllocator *>(malloc_pool);
if (OB_ISNULL(alloced_buf = allocator->alloc(alloc_size))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("failed to allocate memory", K(ret), K(alloc_size));
@ -40,14 +41,14 @@ void* parser_alloc_buffer(void* malloc_pool, const int64_t alloc_size)
return alloced_buf;
}
void parser_free_buffer(void* malloc_pool, void* buffer)
void parser_free_buffer(void *malloc_pool, void *buffer)
{
int ret = OB_SUCCESS;
if (OB_ISNULL(malloc_pool)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid null malloc pool", K(ret));
} else {
ObIAllocator* allocator = static_cast<ObIAllocator*>(malloc_pool);
ObIAllocator *allocator = static_cast<ObIAllocator *>(malloc_pool);
allocator->free(buffer);
}
}