summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-memory.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug 21161 - Update the FSF addressTobias Mueller2009-07-101-1/+1
| | | | | | No comment. Signed-off-by: Colin Walters <walters@verbum.org>
* 2007-07-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-07-141-1/+1
| | | | * Add indent-tabs-mode: nil to all file headers.
* 2006-10-23 David Zeuthen <davidz@redhat.com>David Zeuthen2006-10-231-15/+14
| | | | | | | | | | | | | | * dbus/dbus-memory.c: Use atomic variable to protect n_blocks_outstanding otherwise OOM will be reported using SMP on some arches * bus/dispatch.c: Add missing end of line characters * bus/desktop-file.c (parse_section_start, parse_key_value) (bus_desktop_file_load): Propertly handle OOM * dbus/dbus-threads.c (init_uninitialized_locks): Check that thread_init_generation equals _dbus_current_generation, not 0
* 2006-10-21 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-211-10/+41
| | | | | | | * dbus/dbus-message.h: put #ifndef DBUS_DISABLE_DEPRECATED around dbus_message_iter_get_array_len(). * throughout: documentation improvements.
* * s/D-BUS/D-Bus/gJohn (J5) Palmieri2006-08-031-4/+4
|
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-161-0/+2
| | | | | | | | | | * test/unused-code-gc.py: hacky script to find code that's used only by the bus (not libdbus) or used only by tests or not used at all. It has some false alarms, but looks like we can clean up a lot of size from libdbus. * dbus/dbus-sysdeps.c, dbus/dbus-sysdeps-utils.c, dbus/Makefile.am: initially move 10K of binary size out of libdbus
* 2005-01-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-151-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Land the new message args API and type system. This patch is huge, but the public API change is not really large. The set of D-BUS types has changed somewhat, and the arg "getters" are more geared toward language bindings; they don't make a copy, etc. There are also some known issues. See these emails for details on this huge patch: http://lists.freedesktop.org/archives/dbus/2004-December/001836.html http://lists.freedesktop.org/archives/dbus/2005-January/001922.html * dbus/dbus-marshal-*: all the new stuff * dbus/dbus-message.c: basically rewritten * dbus/dbus-memory.c (check_guards): with "guards" enabled, init freed blocks to be all non-nul bytes so using freed memory is less likely to work right * dbus/dbus-internals.c (_dbus_test_oom_handling): add DBUS_FAIL_MALLOC=N environment variable, so you can do DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or DBUS_FAIL_MALLOC=10 to make it really, really, really slow and thorough. * qt/message.cpp: port to the new message args API (operator<<): use str.utf8() rather than str.unicode() (pretty sure this is right from the Qt docs?) * glib/dbus-gvalue.c: port to the new message args API * bus/dispatch.c, bus/driver.c: port to the new message args API * dbus/dbus-string.c (_dbus_string_init_const_len): initialize the "locked" flag to TRUE and align_offset to 0; I guess we never looked at these anyhow, but seems cleaner. * dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING): move allocation padding macro to this header; use it to implement (_DBUS_STRING_STATIC): ability to declare a static string. * dbus/dbus-message.c (_dbus_message_has_type_interface_member): change to return TRUE if the interface is not set. * dbus/dbus-string.[hc]: move the D-BUS specific validation stuff to dbus-marshal-validate.[hc] * dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from dbus-internals.c * dbus/Makefile.am: cut over from dbus-marshal.[hc] to dbus-marshal-*.[hc] * dbus/dbus-object-tree.c (_dbus_decompose_path): move this function here from dbus-marshal.c
* 2004-10-17 Colin Walters <walters@verbum.org>Colin Walters2004-10-181-9/+9
| | | | | | * dbus/dbus-memory.c (_dbus_initialize_malloc_debug, check_guards) (dbus_malloc, dbus_malloc0, dbus_realloc): Fix up printf format specifier mismatches.
* 2004-08-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-08-101-1/+1
| | | | | * COPYING: switch to Academic Free License version 2.1 instead of 2.0, to resolve complaints about patent termination clause.
* 2003-12-02 Richard Hult <richard@imendio.com>Richard Hult2003-12-021-1/+1
| | | | | * Update AFL version to 2.0 throughout the source files to reflect the update that was done a while ago.
* 2003-06-29 Miloslav Trmac <mitr@volny.cz>Miloslav Trmac2003-06-281-1/+42
| | | | | | | | * dbus/dbus-memory.c (dbus_realloc): Don't check guards after shrinking the allocated block. (_dbus_memory_test): New function. * dbus/dbus-test.h: Add _dbus_memory_test (). * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): Call it.
* 2003-05-08 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-05-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-spawn.c: s/_exit/exit/ because it was keeping gcov data from getting written, and there wasn't a good reason to use _exit really. * test/decode-gcov.c (mark_inside_dbus_build_tests): don't count dbus_verbose lines in test coverage (main): add list of functions sorted by # of untested blocks to the coverage report * dbus/dbus-mempool.c: put some test-only code in DBUS_BUILD_TESTS * dbus/dbus-marshal.c (_dbus_marshal_test): extend test coverage * dbus/dbus-message-handler.c (_dbus_message_handler_test): extend test coverage * test/data/auth/cancel.auth-script: test canceling an authentication * dbus/Makefile.am: remove dbus-server-debug.[hc] for now, as they aren't used. in CVS history if we end up needing them.
* 2003-04-29 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-291-32/+80
| | | | | | | | | * glib/dbus-gmain.c: docs cleanups * dbus/dbus-types.h: add docs on int64 types * dbus/dbus-memory.c: fix docs to avoid putting private API in public API docs section
* 2003-04-05 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-051-3/+9
| | | | | | | | * dbus/dbus-string.c: docs warning * dbus/dbus-spawn.c: missing docs * dbus/dbus-memory.c (struct ShutdownClosure): missing docs
* 2003-03-30 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-311-23/+20
| | | | | | | | | | | | | | | | | | | | * 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>
* 2003-03-28 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-03-281-1/+1
| | | | | | | | | * dbus/dbus-bus.c: (bus_data_free), (dbus_bus_get): * dbus/dbus-bus.h: Add dbus_bus_get. * dbus/dbus-memory.c: Fix a doc comment.
* 2003-03-28 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-281-10/+45
| | | | | | | | | | | | | | | | | | | * bus/test.c (bus_test_flush_bus): remove the sleep from here, I think it may have just been superstition. Not sure. * dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM failures that were not being handled. * dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling * dbus/dbus-memory.c: add ability to set number of mallocs in a row that will fail on out-of-memory. * dbus/dbus-internals.c (_dbus_test_oom_handling): convenience function for testing out-of-memory handling. * bus/config-loader-expat.c (memsuite): don't wrap the dbus allocation functions, they do map exactly to the expat ones.
* 2003-03-23 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-241-8/+153
| | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-threads.c (dbus_mutex_new, dbus_condvar_new): with DBUS_BUILD_TESTS, actually alloc/free a block of memory for the mutex, so we can check for proper memory management and OOM handling. * dbus/dbus-dataslot.c: remove the mutex from DBusDataSlotAllocator and lock it manually when using it, to simplify fitting it into the global slots framework. * dbus/dbus-threads.c (init_static_locks): rework how we're handling global locks so they are easily shut down. * bus/policy.c (bus_policy_append_rule): fix * bus/test-main.c (main): check for memleaks * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make test suite check for memleaks * dbus/dbus-memory.c: add support in test mode for tracking number of outstanding blocks
* 2003-03-16 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-161-0/+9
| | | | | | | | * dbus/dbus-bus.c (ensure_bus_data): handle failure to set connection data * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
* 2003-03-16 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak this. always run the test suite before commit... * bus/*: adapt to DBusConnection API changes * glib/dbus-gmain.c: adapt to DBusConnection API changes, requires renaming stuff to avoid dbus_connection_dispatch name conflict. * dbus/dbus-transport.c (_dbus_transport_queue_messages): new function * dbus/dbus-message.c (_dbus_message_loader_queue_messages): separate from _dbus_message_loader_return_buffer() * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove this, because it's now always broken to use; the number of messages in queue vs. the number still buffered by the message loader is undefined/meaningless. Should use dbus_connection_get_dispatch_state(). (dbus_connection_dispatch): rename from dbus_connection_dispatch_message
* 2003-03-16 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-161-21/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Oops - test code was only testing failure of around 30 of the mallocs in the test path, but it turns out there are 500+ mallocs. I believe this was due to misguided linking setup such that there was one copy of dbus_malloc etc. in the daemon and one in the shared lib, and only daemon mallocs were tested. In any case, the test case now tests all 500+ mallocs, and doesn't pass yet, though there are lots of fixes in this patch. * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix this so that it doesn't need to allocate memory, since it has no way of indicating failure due to OOM (and would be annoying if it did). * dbus/dbus-list.c (_dbus_list_pop_first_link): new function * bus/Makefile.am: rearrange to create two self-contained libraries, to avoid having libraries with overlapping symbols. that was resulting in weirdness, e.g. I'm pretty sure there were two copies of global static variables. * dbus/dbus-internals.c: move the malloc debug stuff to dbus-memory.c * dbus/dbus-list.c (free_link): free list mempool if it becomes empty. * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function * dbus/dbus-address.c (dbus_parse_address): free list nodes on failure. * bus/dispatch.c (bus_dispatch_add_connection): free message_handler_slot when no longer using it, so memory leak checkers are happy for the test suite. * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name * bus/bus.c (new_connection_callback): disconnect in here if bus_connections_setup_connection fails. * bus/connection.c (bus_connections_unref): fix to free the connections (bus_connections_setup_connection): if this fails, don't disconnect the connection, just be sure there are no side effects. * dbus/dbus-string.c (undo_alignment): unbreak this * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were leaking (_dbus_auth_new): fix the order in which we free strings on OOM failure * bus/connection.c (bus_connection_disconnected): fix to not send ServiceDeleted multiple times in case of memory allocation failure * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to get the base service name (dbus_bus_register_client): don't return base service name, instead store it on the DBusConnection and have an accessor function for it. (dbus_bus_register_client): rename dbus_bus_register() * bus/dispatch.c (check_hello_message): verify that other connections on the bus also got the correct results, not just the one sending hello
* 2003-03-15 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-151-0/+6
| | | | | | | | | | | | | | | | | | * bus/dispatch.c (bus_dispatch_test): OK, now finally actually write useful test code, after all that futzing around ;-) Test does not yet pass because we can't handle OOM in _dbus_transport_messages_pending (basically, dbus_connection_preallocate_send() does not prealloc the write watch). To fix this, I think we need to add new stuff to set_watch_functions, namely a SetEnabled function so we can alloc the watch earlier, then enable it later. * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move dbus-memory.c to the convenience lib * bus/test.c: rename some static functions to keep them clearly distinct from stuff in connection.c. Handle client disconnection.
* 2003-03-14 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe transport, tests more of the real codepath. Set up clients with bus_setup_debug_client. * bus/test.c (bus_setup_debug_client): function to set up debug "clients" on the main loop * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe support * dbus/dbus-server.c (dbus_server_listen): add debug-pipe server type * dbus/dbus-server-debug.c: support a debug server based on pipes * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function (_dbus_close): new function * configure.in: check for socketpair
* 2003-03-14 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-03-151-0/+178
| | | | | | | | | | | | | | | | | | | | | * dbus/dbus-memory.c: add a "detect buffer overwrites on free" cheesy hack * dbus/dbus-transport-debug.c: rework this a good bit to be less complicated. hopefully still works. * dbus/dbus-server-debug.c (handle_new_client): remove timeout manually * glib/dbus-gmain.c (timeout_handler): don't remove timeout after running it * dbus/dbus-message.c (dbus_message_copy): rename from dbus_message_new_from_message, fix it up to copy all the message fields, add test case * bus/dispatch.c (bus_dispatch_test): add some more test code, not quite passing yet
* 2003-02-21 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-211-0/+24
| | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-marshal.c: (_dbus_demarshal_string_array): Make string arrays NULL-terminated. * dbus/dbus-memory.c: (dbus_free_string_array): * dbus/dbus-memory.h: New function for freeing NULL-terminated string arrays. * dbus/dbus-message-builder.c: (append_quoted_string), (_dbus_message_data_load): Add support for array types. * dbus/dbus-message.c: (check_message_handling): Add more types as test cases. * dbus/dbus-sysdeps.c: (_dbus_string_parse_int), (_dbus_string_parse_double): Add the start offset to the end offset. * test/data/valid-messages/lots-of-arguments.message: New test message with lots of arguments.
* 2003-02-15 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-151-4/+4
| | | | | | | | * dbus/dbus-list.c: (_dbus_list_append_link), (_dbus_list_prepend_link): * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0), (dbus_realloc): Warning fixes.
* 2003-02-15 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-151-3/+69
| | | | | | | | | | | | * dbus/dbus-internals.h: Fix build without tests. * dbus/dbus-list.c: (alloc_link): Fix a segfault when a malloc fails. * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc), (dbus_malloc0), (dbus_realloc): Add support for malloc debugging.
* 2003-02-14 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-02-141-1/+11
| | | | | | | | | | | * dbus/dbus-mempool.c: fail if the debug functions so indicate * dbus/dbus-memory.c: fail if the debug functions indicate we should * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter) (_dbus_decrement_fail_alloc_counter): debug functions to simulate memory allocation failures
* 2002-11-23 Havoc Pennington <hp@pobox.com>Havoc Pennington2002-11-231-12/+12
| | | | | | | | | | | | | | | | | | | | | * configure.in: pile on more warning flags if using gcc * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have to document static functions * configure.in: add summary to end of configure so it looks nice and attractive * dbus/dbus-hash.c: finish implementation and write unit tests and docs * configure.in: add --enable-tests to enable unit tests * dbus/dbus-test.c: test program to run unit tests for all files in dbus/*, initially runs a test for dbus-hash.c * dbus/dbus-internals.h: file to hold some internal utility stuff
* 2002-11-22 Havoc Pennington <hp@redhat.com>Havoc Pennington2002-11-221-0/+8
| | | | | | | * dbus/dbus-hash.c: copy in Tcl hash table, not yet "ported" away from Tcl * dbus/dbus-types.h: header for types such as dbus_bool_t
* 2002-11-22 Havoc Pennington <hp@redhat.com>Havoc Pennington2002-11-221-0/+139
* dbus/dbus.h: fixups for doc warnings * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up macros (QUIET): make it quiet so we can see warnings * dbus/dbus-memory.c: teach D-BUS to allocate and free memory