1
1

use memalign instead of malloc + manually alignment in the mvapi mpool

revert commit 10243

This commit was SVN r10247.
Этот коммит содержится в:
Sven Stork 2006-06-07 23:21:23 +00:00
родитель 5c72ca01fd
Коммит c31e6f9767
3 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@ -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);
}