| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2007, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: barena.h $ |
|---|
| 11 | * $brcm_Revision: 2 $ |
|---|
| 12 | * $brcm_Date: 2/14/07 5:46p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Arena alloc library |
|---|
| 17 | * |
|---|
| 18 | * Revision History: |
|---|
| 19 | * |
|---|
| 20 | * $brcm_Log: /BSEAV/lib/utils/barena.h $ |
|---|
| 21 | * |
|---|
| 22 | * 2 2/14/07 5:46p vsilyaev |
|---|
| 23 | * PR 25701: Added code to dump content/status of allocator |
|---|
| 24 | * |
|---|
| 25 | * 1 2/5/07 5:29p vsilyaev |
|---|
| 26 | * PR 25701:Portions of stackable parsing framework |
|---|
| 27 | * |
|---|
| 28 | * |
|---|
| 29 | *******************************************************************************/ |
|---|
| 30 | #ifndef _BARENA_H__ |
|---|
| 31 | #define _BARENA_H__ |
|---|
| 32 | #include "balloc.h" |
|---|
| 33 | |
|---|
| 34 | #ifdef __cplusplus |
|---|
| 35 | extern "C" |
|---|
| 36 | { |
|---|
| 37 | #endif |
|---|
| 38 | |
|---|
| 39 | typedef struct barena *barena_t; |
|---|
| 40 | barena_t barena_create(balloc_iface_t alloc, size_t arena_size); |
|---|
| 41 | void barena_destroy(barena_t arena); |
|---|
| 42 | balloc_iface_t barena_alloc_iface(barena_t arena); |
|---|
| 43 | |
|---|
| 44 | void *barena_alloc(barena_t arena, size_t size); |
|---|
| 45 | void barena_free(barena_t arena, void *ptr); |
|---|
| 46 | bool barena_test_block(barena_t arena, void *ptr); |
|---|
| 47 | |
|---|
| 48 | void barena_join(barena_t parent, barena_t child); |
|---|
| 49 | barena_t barena_last_child(barena_t arena); |
|---|
| 50 | void barena_detach(barena_t parent, barena_t child); |
|---|
| 51 | void barena_dump(barena_t arena); |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | #ifdef __cplusplus |
|---|
| 55 | } |
|---|
| 56 | #endif |
|---|
| 57 | |
|---|
| 58 | #endif /* __BARENA_H__ */ |
|---|
| 59 | |
|---|
| 60 | |
|---|