Gah; some non-final code got merged in by accident. Remove debugging
printf and put in the final test code for malloc. This commit was SVN r20924.
Этот коммит содержится в:
родитель
bf17ce1d3f
Коммит
0f517c3d3f
@ -752,8 +752,6 @@ static void opal_memory_ptmalloc2_malloc_init_hook(void)
|
||||
}
|
||||
|
||||
if (want_rcache) {
|
||||
const char str[] = "using ptmallo\n";
|
||||
write(1, str, sizeof(str));
|
||||
/* Initialize ptmalloc */
|
||||
ptmalloc_init();
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
/* Include <link.h> for _DYNAMIC */
|
||||
#include <link.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include "opal/constants.h"
|
||||
#include "opal/mca/memory/memory.h"
|
||||
@ -63,6 +64,7 @@ bool opal_memory_ptmalloc2_memalign_invoked = false;
|
||||
|
||||
static int ptmalloc2_open(void)
|
||||
{
|
||||
void *p;
|
||||
/* We always provide munmap support as part of libopen-pal.la. */
|
||||
int val = OPAL_MEMORY_MUNMAP_SUPPORT;
|
||||
|
||||
@ -90,13 +92,19 @@ static int ptmalloc2_open(void)
|
||||
opal_memory_ptmalloc2_memalign_invoked = false;
|
||||
opal_memory_ptmalloc2_free_invoked = false;
|
||||
|
||||
void *p = malloc(1024 * 1024 * 4);
|
||||
p = malloc(1024 * 1024 * 4);
|
||||
if (NULL == p) {
|
||||
return OPAL_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
p = realloc(p, 1024 * 1024 * 4 + 32);
|
||||
if (NULL == p) {
|
||||
return OPAL_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
realloc(p, 1024 * 1024 * 4 + 32);
|
||||
free(p);
|
||||
memalign(1, 1024 * 1024);
|
||||
p = memalign(1, 1024 * 1024);
|
||||
if (NULL == p) {
|
||||
return OPAL_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
free(p);
|
||||
|
||||
if (opal_memory_ptmalloc2_malloc_invoked &&
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user