3a9179a0d7
This commit was SVN r6267.
60 строки
1.2 KiB
C
60 строки
1.2 KiB
C
/*
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
* All rights reserved.
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
* All rights reserved.
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
* University of Stuttgart. All rights reserved.
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
* All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "mpi.h"
|
|
#include "include/constants.h"
|
|
#include "mca/mca.h"
|
|
#include "mca/base/base.h"
|
|
|
|
|
|
int mca_base_alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
|
|
{
|
|
void *temp;
|
|
|
|
/* Error checks */
|
|
|
|
if (0 == size)
|
|
return OMPI_SUCCESS;
|
|
else if (size < 0)
|
|
return OMPI_ERROR;
|
|
|
|
/* Do the alloc */
|
|
|
|
temp = malloc(size);
|
|
if (NULL == temp)
|
|
return OMPI_ERROR;
|
|
|
|
/* All done */
|
|
|
|
*((void **) baseptr) = temp;
|
|
return OMPI_SUCCESS;
|
|
}
|
|
|
|
|
|
int mca_base_free_mem(void *baseptr)
|
|
{
|
|
if (NULL != baseptr)
|
|
free(baseptr);
|
|
|
|
return OMPI_SUCCESS;
|
|
}
|
|
|