removing the memory allocator tests as we are
moving things around and these will frequently break This commit was SVN r1267.
Этот коммит содержится в:
родитель
acd1ec3d1f
Коммит
44d2bd5259
@ -5,4 +5,4 @@
|
||||
|
||||
include $(top_srcdir)/config/Makefile.options
|
||||
|
||||
SUBDIRS = support mem class util threads
|
||||
SUBDIRS = support class util threads
|
||||
|
@ -1,21 +0,0 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
include $(top_srcdir)/config/Makefile.options
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/test/support -I. -DOMPI_ENABLE_DEBUG_OVERRIDE=1
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
alloc_test
|
||||
|
||||
alloc_test_SOURCES = alloc_test.c
|
||||
alloc_test_LDADD = \
|
||||
$(top_builddir)/src/mca/mem/base/mem_base_allocator.lo \
|
||||
$(top_builddir)/src/threads/mutex.lo \
|
||||
$(top_builddir)/src/threads/mutex_pthread.lo \
|
||||
$(top_builddir)/src/threads/mutex_spinlock.lo \
|
||||
$(top_builddir)/src/class/ompi_object.lo \
|
||||
$(top_builddir)/src/mem/malloc.lo \
|
||||
$(top_builddir)/src/util/output.lo
|
||||
|
@ -1,41 +0,0 @@
|
||||
#include "mca/mem/base/mem_base_allocator.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* the multiple to allocate -- for testing purposes */
|
||||
#define NUM_TIMES_ALLOC 5
|
||||
|
||||
void * allocate(size_t *);
|
||||
|
||||
|
||||
void* allocate(size_t * size) {
|
||||
*size *= NUM_TIMES_ALLOC;
|
||||
return((void *)malloc(*size));
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
void * orig = (void *) 1;
|
||||
int choice;
|
||||
mca_mem_options_t * mem_options = mca_mem_init(30, allocate, free);
|
||||
printf("Address of mem_options_t: %p \n", (void *)mem_options);
|
||||
while(choice)
|
||||
{
|
||||
printf("allocate: 1 free: 2 cleanup: 3 exit: 0 ");
|
||||
scanf("%d", &choice);
|
||||
if(1 == choice) {
|
||||
printf("enter size: ");
|
||||
scanf("%d", &choice);
|
||||
orig = mca_mem_alloc(mem_options, choice);
|
||||
printf("the pointer of the allocated region: %p\n", orig);
|
||||
} else if (2 == choice) {
|
||||
printf("enter pointer to free: ");
|
||||
scanf("%p", &orig);
|
||||
mca_mem_free(mem_options, orig);
|
||||
} else if (3 == choice) {
|
||||
mca_mem_cleanup(mem_options);
|
||||
} else if (0 != choice) {
|
||||
printf("invalid option\n");
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
Загрузка…
Ссылка в новой задаче
Block a user