Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
288a7087
Commit
288a7087
authored
Apr 12, 2008
by
Max Kellermann
Committed by
Eric Wong
Apr 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allocate playerData_pd from heap instead of shm
git-svn-id:
https://svn.musicpd.org/mpd/trunk@7308
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
eb5d51c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
12 deletions
+2
-12
os_compat.h
src/os_compat.h
+0
-4
playerData.c
src/playerData.c
+2
-8
No files found.
src/os_compat.h
View file @
288a7087
...
...
@@ -70,10 +70,6 @@
#include <stddef.h>
/* needed? this defines NULL + offsetof() */
#include <resolv.h>
/* remove when we switch to pthreads: */
#include <sys/ipc.h>
#include <sys/shm.h>
#ifdef HAVE_UN
#include <sys/un.h>
#endif
...
...
src/playerData.c
View file @
288a7087
...
...
@@ -34,7 +34,6 @@ void initPlayerData(void)
{
float
perc
=
DEFAULT_BUFFER_BEFORE_PLAY
;
char
*
test
;
int
shmid
;
int
crossfade
=
0
;
size_t
bufferSize
=
DEFAULT_BUFFER_SIZE
;
size_t
allocationSize
;
...
...
@@ -78,12 +77,7 @@ void initPlayerData(void)
/* for playerData struct */
allocationSize
=
sizeof
(
PlayerData
);
if
((
shmid
=
shmget
(
IPC_PRIVATE
,
allocationSize
,
IPC_CREAT
|
0600
))
<
0
)
FATAL
(
"problems shmget'ing
\n
"
);
if
(
!
(
playerData_pd
=
shmat
(
shmid
,
NULL
,
0
)))
FATAL
(
"problems shmat'ing
\n
"
);
if
(
shmctl
(
shmid
,
IPC_RMID
,
NULL
)
<
0
)
FATAL
(
"problems shmctl'ing
\n
"
);
playerData_pd
=
xmalloc
(
allocationSize
);
playerData_pd
->
audioDeviceStates
=
xmalloc
(
device_array_size
);
...
...
@@ -129,5 +123,5 @@ void freePlayerData(void)
waitpid
(
-
1
,
NULL
,
0
);
free
(
playerData_pd
->
audioDeviceStates
);
shmdt
(
playerData_pd
);
free
(
playerData_pd
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment