---
opal/class/opal_free_list.c | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diff --quilt old/opal/class/opal_free_list.c new/opal/class/opal_free_list.c
--- old/opal/class/opal_free_list.c
+++ new/opal/class/opal_free_list.c
@@ -22,23 +22,25 @@
#include "opal/sys/cache.h"
static void opal_free_list_construct(opal_free_list_t* fl);
static void opal_free_list_destruct(opal_free_list_t* fl);
+static void opal_free_list_cache_construct(opal_free_list_t* fl);
+static void opal_free_list_cache_destruct(opal_free_list_t* fl);
-OBJ_CLASS_INSTANCE(opal_free_list_t,
- opal_list_t,
- opal_free_list_construct,
- opal_free_list_destruct);
+OBJ_CLASS_INSTANCE_CACHE(opal_free_list_t,
+ opal_list_t,
+ opal_free_list_construct,
+ opal_free_list_destruct,
+ opal_free_list_cache_construct,
+ opal_free_list_cache_destruct);
OBJ_CLASS_INSTANCE(opal_free_list_item_t,
opal_list_item_t,
NULL, NULL);
static void opal_free_list_construct(opal_free_list_t* fl)
{
- OBJ_CONSTRUCT(&fl->fl_lock, opal_mutex_t);
- OBJ_CONSTRUCT(&fl->fl_condition, opal_condition_t);
fl->fl_max_to_alloc = 0;
fl->fl_num_allocated = 0;
fl->fl_num_per_alloc = 0;
fl->fl_num_waiting = 0;
fl->fl_elem_size = 0;
@@ -55,10 +57,20 @@ static void opal_free_list_destruct(opal
OBJ_DESTRUCT(item);
free(item);
}
OBJ_DESTRUCT(&fl->fl_allocations);
+}
+
+static void opal_free_list_cache_construct(opal_free_list_t* fl)
+{
+ OBJ_CONSTRUCT(&fl->fl_lock, opal_mutex_t);
+ OBJ_CONSTRUCT(&fl->fl_condition, opal_condition_t);
+}
+
+static void opal_free_list_cache_destruct(opal_free_list_t* fl)
+{
OBJ_DESTRUCT(&fl->fl_condition);
OBJ_DESTRUCT(&fl->fl_lock);
}
int opal_free_list_init(
---
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