00001 #ifndef _heap_h_included_ 00002 #define _heap_h_included_ 00003 00004 /*! 00005 * @file heap.h 00006 * 00007 * @brief Heap management API 00008 * 00009 * The two examples of modular development here are the two heap 00010 * management schemes, 00011 * @link jvm/src/heap_simple.c heap_simple.c@endlink 00012 * and @link jvm/src/heap_bimodal.c heap_bimodal.c@endlink. 00013 * This common header file defines the prototypes for both by way 00014 * of the @link #CONFIG_HEAP_TYPE_SIMPLE CONFIG_HEAP_TYPE_xxx@endlink 00015 * symbol definition. 00016 * 00017 * Each heap allocation algorithm will have a section just like 00018 * those defined here in this file so that these macros will expand 00019 * to point to the API as implemented by that algoritm. Simply 00020 * replicate one of the definition sections and change the function 00021 * names from @b _simple (et al) to @b _newalgorithm . 00022 * 00023 * 00024 * @section Control 00025 * 00026 * \$URL: https://svn.apache.org/path/name/heap.h $ \$Id: heap.h 0 09/28/2005 dlydick $ 00027 * 00028 * Copyright 2005 The Apache Software Foundation 00029 * or its licensors, as applicable. 00030 * 00031 * Licensed under the Apache License, Version 2.0 ("the License"); 00032 * you may not use this file except in compliance with the License. 00033 * You may obtain a copy of the License at 00034 * 00035 * http://www.apache.org/licenses/LICENSE-2.0 00036 * 00037 * Unless required by applicable law or agreed to in writing, 00038 * software distributed under the License is distributed on an 00039 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 00040 * either express or implied. 00041 * 00042 * See the License for the specific language governing permissions 00043 * and limitations under the License. 00044 * 00045 * @version \$LastChangedRevision: 0 $ 00046 * 00047 * @date \$LastChangedDate: 09/28/2005 $ 00048 * 00049 * @author \$LastChangedBy: dlydick $ 00050 * Original code contributed by Daniel Lydick on 09/28/2005. 00051 * 00052 * @section Reference 00053 * 00054 */ 00055 00056 ARCH_COPYRIGHT_APACHE(heap, h, "$URL: https://svn.apache.org/path/name/heap.h $ $Id: heap.h 0 09/28/2005 dlydick $"); 00057 00058 #ifdef CONFIG_HEAP_TYPE_SIMPLE 00059 /*! 00060 * @name Simple heap model definitions 00061 * 00062 * @brief Expand the @b HEAP_xxx() macros into the simple heap model as 00063 * implemented by @link jvm/src/heap_simple.c heap_simple.c@endlink. 00064 * 00065 */ 00066 00067 /*@{ */ /* Begin grouped definitions */ 00068 00069 #define HEAP_INIT heap_init_simple 00070 #define HEAP_SHUTDOWN heap_shutdown_simple 00071 #define HEAP_GET_METHOD heap_get_method_simple 00072 #define HEAP_GET_STACK heap_get_stack_simple 00073 #define HEAP_GET_DATA heap_get_data_simple 00074 #define HEAP_FREE_METHOD heap_free_method_simple 00075 #define HEAP_FREE_STACK heap_free_stack_simple 00076 #define HEAP_FREE_DATA heap_free_data_simple 00077 #define HEAP_GET_ERROR heap_get_error_simple 00078 00079 /*@} */ /* End of grouped definitions */ 00080 #endif 00081 00082 #ifdef CONFIG_HEAP_TYPE_BIMODAL 00083 /*! 00084 * @name Bimodal heap model definitions 00085 * 00086 * @brief Expand the @b HEAP_xxx() macros into the bimidal heap model as 00087 * implemented by 00088 * @link jvm/src/heap_bimodal.c heap_bimodal.c@endlink. 00089 * 00090 */ 00091 00092 /*@{ */ /* Begin grouped definitions */ 00093 00094 #define HEAP_INIT heap_init_bimodal 00095 #define HEAP_SHUTDOWN heap_shutdown_bimodal 00096 #define HEAP_GET_METHOD heap_get_method_bimodal 00097 #define HEAP_GET_STACK heap_get_stack_bimodal 00098 #define HEAP_GET_DATA heap_get_data_bimodal 00099 #define HEAP_FREE_METHOD heap_free_method_bimodal 00100 #define HEAP_FREE_STACK heap_free_stack_bimodal 00101 #define HEAP_FREE_DATA heap_free_data_bimodal 00102 #define HEAP_GET_ERROR heap_get_error_bimodal 00103 00104 /*@} */ /* End of grouped definitions */ 00105 #endif 00106 00107 extern rvoid HEAP_INIT(rvoid); 00108 extern rvoid HEAP_SHUTDOWN(rvoid); 00109 00110 extern rvoid *HEAP_GET_METHOD(int size, rboolean clrmem_flag); 00111 extern rvoid *HEAP_GET_STACK(int size, rboolean clrmem_flag); 00112 extern rvoid *HEAP_GET_DATA(int size, rboolean clrmem_flag); 00113 00114 extern rvoid HEAP_FREE_METHOD(rvoid *heap_block); 00115 extern rvoid HEAP_FREE_STACK(rvoid *heap_block); 00116 extern rvoid HEAP_FREE_DATA(rvoid *heap_block); 00117 00118 extern int HEAP_GET_ERROR(rvoid *badptr); 00119 00120 #endif /* _heap_h_included_ */ 00121 00122 00123 /* EOF */ 00124