Defines | Functions | Variables

Arena.cc File Reference

A brief file description. More...

#include "libts.h"
#include <assert.h>
#include <string.h>
Include dependency graph for Arena.cc:

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 ArenaBlockblk_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)

Detailed Description

A brief file description.

License

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 Documentation

#define DEFAULT_ALLOC_SIZE   1024

Definition at line 29 of 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().


Function Documentation

static ArenaBlock* blk_alloc ( int  size  )  [inline, static]
static void blk_free ( ArenaBlock blk  )  [inline, static]
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().


Variable Documentation

Allocator defaultSizeArenaBlock("ArenaBlock", DEFAULT_ALLOC_SIZE) [static]

Referenced by blk_alloc(), and blk_free().