summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-09-18 21:24:26 +0200
committerLennart Poettering <lennart@poettering.net>2009-09-18 22:16:25 +0200
commitc010172c6649f6f9e6f00aea3cc963ef1b34e3c3 (patch)
treedf7ffc8aae1ab86fe30539adfd1818bf146f69e0
parent8f299687882a33093cad32936672ba649306739b (diff)
memblock: modernizations
-rw-r--r--src/pulsecore/memblock.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c
index 47f298a4..2b187f04 100644
--- a/src/pulsecore/memblock.c
+++ b/src/pulsecore/memblock.c
@@ -898,7 +898,7 @@ static pa_memimport_segment* segment_attach(pa_memimport *i, uint32_t shm_id) {
if (pa_hashmap_size(i->segments) >= PA_MEMIMPORT_SEGMENTS_MAX)
return NULL;
- seg = pa_xnew(pa_memimport_segment, 1);
+ seg = pa_xnew0(pa_memimport_segment, 1);
if (pa_shm_attach_ro(&seg->memory, shm_id) < 0) {
pa_xfree(seg);
@@ -906,10 +906,9 @@ static pa_memimport_segment* segment_attach(pa_memimport *i, uint32_t shm_id) {
}
seg->import = i;
- seg->n_blocks = 0;
seg->trap = pa_memtrap_add(seg->memory.ptr, seg->memory.size);
- pa_hashmap_put(i->segments, PA_UINT32_TO_PTR(shm_id), seg);
+ pa_hashmap_put(i->segments, PA_UINT32_TO_PTR(seg->memory.id), seg);
return seg;
}