The two examples of modular development here are the two heap management schemes, heap_simple.c and heap_bimodal.c. This common header file defines the prototypes for both by way of the CONFIG_HEAP_TYPE_xxx symbol definition.
Each heap allocation algorithm will have a section just like those defined here in this file so that these macros will expand to point to the API as implemented by that algoritm. Simply replicate one of the definition sections and change the function names from _simple (et al) to _newalgorithm .
Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
Licensed 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 heap.h.
Go to the source code of this file.
Bimodal heap model definitions | |
Expand the HEAP_xxx() macros into the bimidal heap model as implemented by heap_bimodal.c. | |
#define | HEAP_FREE_DATA heap_free_data_bimodal |
#define | HEAP_FREE_DATA heap_free_data_simple |
#define | HEAP_FREE_METHOD heap_free_method_bimodal |
#define | HEAP_FREE_METHOD heap_free_method_simple |
#define | HEAP_FREE_STACK heap_free_stack_bimodal |
#define | HEAP_FREE_STACK heap_free_stack_simple |
#define | HEAP_GET_DATA heap_get_data_bimodal |
#define | HEAP_GET_DATA heap_get_data_simple |
#define | HEAP_GET_ERROR heap_get_error_bimodal |
#define | HEAP_GET_ERROR heap_get_error_simple |
#define | HEAP_GET_METHOD heap_get_method_bimodal |
#define | HEAP_GET_METHOD heap_get_method_simple |
#define | HEAP_GET_STACK heap_get_stack_bimodal |
#define | HEAP_GET_STACK heap_get_stack_simple |
#define | HEAP_INIT heap_init_bimodal |
#define | HEAP_INIT heap_init_simple |
#define | HEAP_SHUTDOWN heap_shutdown_bimodal |
#define | HEAP_SHUTDOWN heap_shutdown_simple |
Functions | |
ARCH_COPYRIGHT_APACHE (heap, h,"$URL: https://svn.apache.org/path/name/heap.h $ $Id: heap.h 0 09/28/2005 dlydick $") | |
rvoid | heap_free_data_simple (rvoid *heap_block) |
Release a previously allocated data block back into the heap for future reallocation. | |
rvoid | heap_free_method_simple (rvoid *heap_block) |
Release a previously allocated method block back into the heap for future reallocation. | |
rvoid | heap_free_stack_simple (rvoid *heap_block) |
Release a previously allocated stack block back into the heap for future reallocation. | |
rvoid * | heap_get_data_simple (int size, rboolean clrmem_flag) |
Allocate memory for a data area from heap to caller. | |
int | heap_get_error_simple (rvoid *badptr) |
Allocation failure diagnostic. | |
rvoid * | heap_get_method_simple (int size, rboolean clrmem_flag) |
Allocate memory for a method from heap to caller. | |
rvoid * | heap_get_stack_simple (int size, rboolean clrmem_flag) |
Allocate memory for a stack area from heap to caller. | |
rvoid | heap_init_simple (rvoid) |
rvoid | heap_shutdown_simple (rvoid) |
|
|
|
|
|
Definition at line 96 of file heap.h. Referenced by cfattrib_loadattribute(), and classfile_loadclassdata(). |
|
|
|
Definition at line 98 of file heap.h. Referenced by argv_init(), cfmsgs_typemsg(), class_get_num_static_fields(), class_get_static_field_data(), classfile_allocate_primative(), jvmutil_print_errtype_stack(), manifest_get_main(), nts_prchar2utf(), nts_prchar2utf_classname(), thread_init(), unicode_cnv2utf(), and utf_isarray(). |
|
Definition at line 99 of file heap.h. Referenced by classfile_loadclassdata(). |
|
Definition at line 100 of file heap.h. Referenced by thread_shutdown(). |
|
Definition at line 101 of file heap.h. Referenced by cfmsgs_typemsg(), class_find_by_cp_entry(), class_static_delete(), jvmutil_print_errtype_stack(), manifest_get_main(), method_find_by_prchar(), and opcode_run(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Allocate memory for a method from heap to caller. When finished, this pointer should be sent back to heap_free_method_simple() for reallocation.
Definition at line 272 of file heap_simple.c. |
|
Allocate memory for a stack area from heap to caller. When finished, this pointer should be sent back to heap_free_stack_simple() for reallocation.
Definition at line 314 of file heap_simple.c. |
|
Allocate memory for a data area from heap to caller. When finished, this pointer should be sent back to heap_free_data_simple() for reallocation.
Definition at line 356 of file heap_simple.c. |
|
Release a previously allocated method block back into the heap for future reallocation.
Definition at line 418 of file heap_simple.c. |
|
Release a previously allocated stack block back into the heap for future reallocation.
Definition at line 439 of file heap_simple.c. |
|
Release a previously allocated data block back into the heap for future reallocation.
Definition at line 460 of file heap_simple.c. |
|
Allocation failure diagnostic. Returns an errno value per "errno.h" if a rnull pointer is passed in, namely from the most recent call to a heap allocation function. It may only be called once before the value is cleared. If a non-null pointer is passed in, ERROR0 is returned and the error status is again cleared.
< Typically found in <errno.h> or <sys/errno.h> < Typically found in <errno.h> or <sys/errno.h> Definition at line 488 of file heap_simple.c. References ERROR0, and heap_last_errno. |