Mercurial > mplayer.hg
comparison osdep/shmem.c @ 9914:3c856c0fc45e
mem mapped area need to be unmapped.
author | albeu |
---|---|
date | Sat, 12 Apr 2003 13:52:21 +0000 |
parents | 86e080e9c31f |
children | 9e11a478a3bc |
comparison
equal
deleted
inserted
replaced
9913:88fe89b46786 | 9914:3c856c0fc45e |
---|---|
92 } | 92 } |
93 ++shmem_type; | 93 ++shmem_type; |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 void shmem_free(void* p){ | 97 void shmem_free(void* p,int size){ |
98 switch(shmem_type){ | 98 switch(shmem_type){ |
99 case 0: | |
100 case 1: | |
101 if(munmap(p,size)) { | |
102 mp_msg(MSGT_OSDEP, MSGL_ERR, "munmap failed on %p %d bytes: %s\n", | |
103 p,size,strerror(errno)); | |
104 } | |
105 break; | |
99 case 2: | 106 case 2: |
100 #ifdef HAVE_SHM | 107 #ifdef HAVE_SHM |
101 if (shmdt(p) == -1) | 108 if (shmdt(p) == -1) |
102 mp_msg(MSGT_OSDEP, MSGL_ERR, "shmfree: shmdt() failed: %s\n", | 109 mp_msg(MSGT_OSDEP, MSGL_ERR, "shmfree: shmdt() failed: %s\n", |
103 strerror(errno)); | 110 strerror(errno)); |