use memalign instead of malloc + manually alignment in the mvapi mpool
revert commit 10243 This commit was SVN r10247.
Этот коммит содержится в:
родитель
5c72ca01fd
Коммит
c31e6f9767
@ -5,7 +5,7 @@
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* Copyright (c) 2004-2006 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.
|
||||
@ -167,8 +167,8 @@ void mca_mpool_gm_free(mca_mpool_base_module_t* mpool, void * addr,
|
||||
{
|
||||
if(registration){
|
||||
mpool->mpool_deregister(mpool, registration);
|
||||
free(addr);
|
||||
}
|
||||
free(addr);
|
||||
}
|
||||
|
||||
int mca_mpool_gm_find(
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* Copyright (c) 2004-2006 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.
|
||||
@ -28,6 +28,10 @@
|
||||
#include "ompi/mca/rcache/base/base.h"
|
||||
#include "ompi/mca/mpool/base/base.h"
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
extern uint32_t mca_mpool_base_page_size;
|
||||
extern uint32_t mca_mpool_base_page_size_log;
|
||||
|
||||
@ -69,9 +73,8 @@ void* mca_mpool_mvapi_alloc(
|
||||
uint32_t flags,
|
||||
mca_mpool_base_registration_t** registration)
|
||||
{
|
||||
|
||||
void* addr_malloc = (void*)malloc(size + mca_mpool_base_page_size);
|
||||
void* addr = (void*) up_align_addr(addr_malloc, mca_mpool_base_page_size_log);
|
||||
void* addr_malloc = (void*)memalign(mca_mpool_base_page_size, size);
|
||||
void* addr = addr_malloc;
|
||||
if(OMPI_SUCCESS != mpool->mpool_register(mpool, addr, size, flags, registration)) {
|
||||
free(addr_malloc);
|
||||
return NULL;
|
||||
@ -199,8 +202,8 @@ void mca_mpool_mvapi_free(mca_mpool_base_module_t* mpool, void * addr,
|
||||
{
|
||||
if(registration){
|
||||
mpool->mpool_deregister(mpool, registration);
|
||||
free(registration->alloc_base);
|
||||
}
|
||||
free(addr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -182,9 +182,8 @@ void mca_mpool_openib_free(mca_mpool_base_module_t* mpool, void * addr,
|
||||
{
|
||||
if(registration){
|
||||
mpool->mpool_deregister(mpool, registration);
|
||||
free(registration->alloc_base);
|
||||
}
|
||||
|
||||
free(addr);
|
||||
}
|
||||
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user