Update opal_free_list_t usage to reflect new class interface.
Please verify your components have been updated correctly. Keep in mind that in terms of threading: OPAL_FREE_LIST_GET -> opal_free_list_get_st OPAL_FREE_LIST_RETURN -> opal_free_list_return_st I used the opal_using_threads() variant anytime it appeared multiple threads could be operating on the free list. If this is not the case update to _st. If multiple threads are always in use change to _mt.
Этот коммит содержится в:
@ -1,3 +1,4 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
@ -9,6 +10,8 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -149,7 +152,8 @@ static void initFreeList(void)
|
||||
OBJ_CONSTRUCT(&ompi_java_buffers, opal_free_list_t);
|
||||
|
||||
int r = opal_free_list_init(&ompi_java_buffers, sizeof(ompi_java_buffer_t),
|
||||
OBJ_CLASS(ompi_java_buffer_t), 2, -1, 2);
|
||||
OBJ_CLASS(ompi_java_buffer_t), 0, 0, 2, -1, 2,
|
||||
NULL, 0, NULL, NULL, NULL);
|
||||
if(r != OPAL_SUCCESS)
|
||||
{
|
||||
fprintf(stderr, "Unable to initialize ompi_java_buffers.\n");
|
||||
@ -511,12 +515,11 @@ static void* getBuffer(JNIEnv *env, ompi_java_buffer_t **item, int size)
|
||||
}
|
||||
else
|
||||
{
|
||||
int rc;
|
||||
opal_free_list_item_t *freeListItem;
|
||||
OPAL_FREE_LIST_GET(&ompi_java_buffers, freeListItem, rc);
|
||||
freeListItem = opal_free_list_get (&ompi_java_buffers);
|
||||
|
||||
ompi_java_exceptionCheck(env,
|
||||
rc==OPAL_SUCCESS ? OMPI_SUCCESS : OMPI_ERROR);
|
||||
ompi_java_exceptionCheck(env, NULL == freeListItem ? OMPI_ERROR :
|
||||
OMPI_SUCCESS);
|
||||
|
||||
*item = (ompi_java_buffer_t*)freeListItem;
|
||||
return (*item)->buffer;
|
||||
@ -532,7 +535,7 @@ static void releaseBuffer(void *ptr, ompi_java_buffer_t *item)
|
||||
else
|
||||
{
|
||||
assert(item->buffer == ptr);
|
||||
OPAL_FREE_LIST_RETURN(&ompi_java_buffers, (opal_free_list_item_t*)item);
|
||||
opal_free_list_return (&ompi_java_buffers, (opal_free_list_item_t*)item);
|
||||
}
|
||||
}
|
||||
|
||||
|
Ссылка в новой задаче
Block a user