@@ -41,19 +41,18 @@ mca_io_romio341_file_open (ompi_communicator_t *comm,
4141// An opal_info_t isn't a full ompi_info_t. so if we're using an MPI call
4242// below with an MPI_Info, we need to create an equivalent MPI_Info. This
4343// isn't ideal but it only happens a few places.
44- ompi_info_t * ompi_info ;
45- ompi_info = OBJ_NEW (ompi_info_t );
46- if (!ompi_info ) { return (MPI_ERR_NO_MEM ); }
47- opal_info_t * opal_info = & (ompi_info -> super );
44+ ompi_info_t ompi_info ;
45+ OBJ_CONSTRUCT (& ompi_info , ompi_info_t );
46+ opal_info_t * opal_info = & (ompi_info .super );
4847 opal_info_dup (info , & opal_info );
4948
5049 data = (mca_io_romio341_data_t * ) fh -> f_io_selected_data ;
5150// OPAL_THREAD_LOCK (&mca_io_romio341_mutex);
52- ret = ROMIO_PREFIX (MPI_File_open )(comm , filename , amode , ompi_info ,
51+ ret = ROMIO_PREFIX (MPI_File_open )(comm , filename , amode , & ompi_info ,
5352 & data -> romio_fh );
5453// OPAL_THREAD_UNLOCK (&mca_io_romio341_mutex);
5554
56- ompi_info_free (& ompi_info );
55+ OBJ_DESTRUCT (& ompi_info );
5756 return ret ;
5857}
5958
@@ -206,20 +205,19 @@ mca_io_romio341_file_set_view (ompi_file_t *fh,
206205// An opal_info_t isn't a full ompi_info_t. so if we're using an MPI call
207206// below with an MPI_Info, we need to create an equivalent MPI_Info. This
208207// isn't ideal but it only happens a few places.
209- ompi_info_t * ompi_info ;
210- ompi_info = OBJ_NEW (ompi_info_t );
211- if (!ompi_info ) { return (MPI_ERR_NO_MEM ); }
212- opal_info_t * opal_info = & (ompi_info -> super );
208+ ompi_info_t ompi_info ;
209+ OBJ_CONSTRUCT (& ompi_info , ompi_info_t );
210+ opal_info_t * opal_info = & (ompi_info .super );
213211 opal_info_dup (info , & opal_info );
214212
215213 data = (mca_io_romio341_data_t * ) fh -> f_io_selected_data ;
216214 OPAL_THREAD_LOCK (& mca_io_romio341_mutex );
217215 ret =
218216 ROMIO_PREFIX (MPI_File_set_view ) (data -> romio_fh , disp , etype , filetype ,
219- datarep , ompi_info );
217+ datarep , & ompi_info );
220218 OPAL_THREAD_UNLOCK (& mca_io_romio341_mutex );
221219
222- ompi_info_free (& ompi_info );
220+ OBJ_DESTRUCT (& ompi_info );
223221 return ret ;
224222}
225223
0 commit comments