2014-04-19 09:03:44 +04:00
|
|
|
/*
|
2016-10-21 09:36:53 +03:00
|
|
|
* Copyright (c) 2014-2016 Mellanox Technologies, Inc.
|
2014-04-19 09:03:44 +04:00
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
* This sample allocates (shmalloc) symmetric memory (1 long integer),
|
|
|
|
* and then frees it. Success of allocation is not checked.
|
|
|
|
*
|
|
|
|
* Produces no output.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <shmem.h>
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
long *x;
|
|
|
|
|
2016-10-21 09:36:53 +03:00
|
|
|
shmem_init();
|
|
|
|
|
|
|
|
x = (long *) shmem_malloc(sizeof(*x));
|
2014-04-19 09:03:44 +04:00
|
|
|
|
2016-10-21 09:36:53 +03:00
|
|
|
shmem_free(x);
|
2014-04-19 09:03:44 +04:00
|
|
|
|
2016-10-21 09:36:53 +03:00
|
|
|
shmem_finalize();
|
2014-04-19 09:03:44 +04:00
|
|
|
}
|
|
|
|
|