In c you can do
shmid = shmget(SHMEM_KEY, sizeof(int*) * n , SHEMEM_MODE | IPC_CREAT);
int* shmem = shmat(shmid, NULL, 0);
to assign first given free memory space as a shared memory.
Is there any way to assigne current memory space as a shared memory?