A brief file description. More...
#include "libts.h"
#include <assert.h>
#include <string.h>
Go to the source code of this file.
Defines | |
#define | DEFAULT_ALLOC_SIZE 1024 |
#define | DEFAULT_BLOCK_SIZE (DEFAULT_ALLOC_SIZE - (sizeof (ArenaBlock) - 8)) |
Functions | |
static ArenaBlock * | blk_alloc (int size) |
static void | blk_free (ArenaBlock *blk) |
static void * | block_alloc (ArenaBlock *block, size_t size, size_t alignment) |
Variables | |
static Allocator | defaultSizeArenaBlock ("ArenaBlock", DEFAULT_ALLOC_SIZE) |
A brief file description.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file Arena.cc.
#define DEFAULT_BLOCK_SIZE (DEFAULT_ALLOC_SIZE - (sizeof (ArenaBlock) - 8)) |
Definition at line 30 of file Arena.cc.
Referenced by Arena::alloc(), blk_alloc(), and blk_free().
static ArenaBlock* blk_alloc | ( | int | size | ) | [inline, static] |
Definition at line 40 of file Arena.cc.
References Allocator::alloc_void(), ats_malloc(), ArenaBlock::data, DEFAULT_BLOCK_SIZE, defaultSizeArenaBlock, ArenaBlock::m_heap_end, ArenaBlock::m_water_level, and ArenaBlock::next.
Referenced by Arena::alloc().
static void blk_free | ( | ArenaBlock * | blk | ) | [inline, static] |
Definition at line 61 of file Arena.cc.
References ats_free(), ArenaBlock::data, DEFAULT_BLOCK_SIZE, defaultSizeArenaBlock, Allocator::free_void(), and ArenaBlock::m_heap_end.
Referenced by Arena::reset().
static void* block_alloc | ( | ArenaBlock * | block, | |
size_t | size, | |||
size_t | alignment | |||
) | [static] |
Definition at line 78 of file Arena.cc.
References ArenaBlock::m_heap_end, and ArenaBlock::m_water_level.
Referenced by Arena::alloc().
Allocator defaultSizeArenaBlock("ArenaBlock", DEFAULT_ALLOC_SIZE) [static] |
Referenced by blk_alloc(), and blk_free().