--- orte/class/orte_pointer_array.c | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --quilt old/orte/class/orte_pointer_array.c new/orte/class/orte_pointer_array.c --- old/orte/class/orte_pointer_array.c +++ new/orte/class/orte_pointer_array.c @@ -27,25 +27,28 @@ #include "orte/class/orte_pointer_array.h" #include "opal/util/output.h" static void orte_pointer_array_construct(orte_pointer_array_t *); static void orte_pointer_array_destruct(orte_pointer_array_t *); +static void orte_pointer_array_cache_construct(orte_pointer_array_t *); +static void orte_pointer_array_cache_destruct(orte_pointer_array_t *); static bool grow_table(orte_pointer_array_t *table); -OBJ_CLASS_INSTANCE( +OBJ_CLASS_INSTANCE_CACHE( orte_pointer_array_t, opal_object_t, orte_pointer_array_construct, - orte_pointer_array_destruct + orte_pointer_array_destruct, + orte_pointer_array_cache_construct, + orte_pointer_array_cache_destruct ); /* * orte_pointer_array constructor */ void orte_pointer_array_construct(orte_pointer_array_t *array) { - OBJ_CONSTRUCT(&array->lock, opal_mutex_t); array->lowest_free = 0; array->number_free = 0; array->size = 0; array->max_size = 0; array->block_size = 0; @@ -59,11 +62,25 @@ void orte_pointer_array_destruct(orte_po { /* free table */ if( NULL != array->addr) { free(array->addr); } +} +/* + * orte_pointer_array cache constructor + */ +void orte_pointer_array_cache_construct(orte_pointer_array_t *array) +{ + OBJ_CONSTRUCT(&array->lock, opal_mutex_t); +} + +/* + * orte_pointer_array cache destructor + */ +void orte_pointer_array_cache_destruct(orte_pointer_array_t *array) +{ OBJ_DESTRUCT(&array->lock); } /** * initialize an array object