summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-mempool.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-03-31 04:01:00 +0000
committerHavoc Pennington <hp@redhat.com>2003-03-31 04:01:00 +0000
commitbc86794f23fa538a405813fb61b531c2eacc9ae1 (patch)
tree42f040afce0d63d312d6f43bf5f6f9bb014c586a /dbus/dbus-mempool.c
parentd361874ef6a94a61fa3e0534d8352392edf9bbb9 (diff)
2003-03-30 Havoc Pennington <hp@pobox.com>
* bus/config-parser.c: hacking * dbus/dbus-memory.c: don't use DBusList for the list of stuff to shut down, since it could cause weirdness with the DBusList lock * dbus/dbus-list.c (_dbus_list_test): add tests for the link-oriented stack routines (alloc_link): free the mempool if the first alloc from it fails * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue * dbus/dbus-string.c (UNICODE_VALID): sync new version of this from GLib (_dbus_string_skip_white): new * doc/config-file.txt (Elements): add <includedir>
Diffstat (limited to 'dbus/dbus-mempool.c')
-rw-r--r--dbus/dbus-mempool.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/dbus/dbus-mempool.c b/dbus/dbus-mempool.c
index 13ba5502..5074c7d2 100644
--- a/dbus/dbus-mempool.c
+++ b/dbus/dbus-mempool.c
@@ -84,7 +84,8 @@ struct DBusMemBlock
* when we free the mem pool.
*/
- int used_so_far; /**< bytes of this block already allocated as elements. */
+ /* this is a long so that "elements" is aligned */
+ long used_so_far; /**< bytes of this block already allocated as elements. */
unsigned char elements[ELEMENT_PADDING]; /**< the block data, actually allocated to required size */
};
@@ -254,7 +255,7 @@ _dbus_mem_pool_alloc (DBusMemPool *pool)
memset (element, '\0', pool->element_size);
pool->allocated_elements += 1;
-
+
return element;
}
else
@@ -311,11 +312,11 @@ _dbus_mem_pool_alloc (DBusMemPool *pool)
}
element = &pool->blocks->elements[pool->blocks->used_so_far];
-
+
pool->blocks->used_so_far += pool->element_size;
pool->allocated_elements += 1;
-
+
return element;
}
}