Commit Graph

42 Commits

Author SHA1 Message Date
Jeff Morriss b6a9b8494c Remove $Id$ and other Subversion leftovers from the doc files.
Change-Id: I28a376f7e0fd90971f65ae9c1105a3ec85221470
Reviewed-on: https://code.wireshark.org/review/204
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-14 01:33:14 +00:00
Bill Meier 8ab9c55618 From Ville Skyttä: Spelling Fixes
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9591


svn path=/trunk/; revision=54387
2013-12-23 15:53:13 +00:00
Evan Huus 828eae73ce Document that pinfo-scoped memory is also needed for anything passed to
add_new_data_source().

svn path=/trunk/; revision=50911
2013-07-26 13:06:50 +00:00
Evan Huus 037fc022da Add wmem queue 'implementation' by wrapping wmem_list and wmem_stack.
Also a bit of misc. refactoring of the stack while I was there, and doc tweaks.

svn path=/trunk/; revision=50769
2013-07-21 21:13:30 +00:00
Evan Huus 6635f5ef67 Replace wmem slist (singly-linked) with wmem list (doubly-linked).
The overhead is not large, and it makes append much faster (O(1) vs O(n)).

It also will make a queue easy to add, which I need for a dissector I'm
writing...

svn path=/trunk/; revision=50744
2013-07-20 20:33:38 +00:00
Evan Huus c574f7d1ea Simple growable array implementation for wmem.
svn path=/trunk/; revision=50400
2013-07-06 04:02:08 +00:00
Evan Huus 8e060a2ad5 Update READMEs.
svn path=/trunk/; revision=50020
2013-06-18 21:47:18 +00:00
Evan Huus 80c51f1df0 Update wmem README for the tree implementation.
svn path=/trunk/; revision=49967
2013-06-16 22:08:56 +00:00
Evan Huus a9c35aa4b6 First batch of doxygen for wmem. Remove some things from README.wmem now that
they're in doxygen instead.

svn path=/trunk/; revision=49583
2013-05-26 02:40:40 +00:00
Evan Huus 5426ba4e02 Minor refactor: make the framework responsible for allocating and freeing the
actual wmem_allocator_t structure. This simplifies the internal API and
deduplicates a few alloc/free calls in the individual allocator implementations.

I'd originally made the allocators responsible for this on purpose with the
idea that they'd be able to optimize something clever based on the type of
allocator, but that's clearly more work and complexity than it's worth given
the small number of allocators we create/destroy.

svn path=/trunk/; revision=49512
2013-05-22 15:42:12 +00:00
Evan Huus f2bdbd2b32 Use a readable name for the wmem callback test. Warn that reallocing memory
for which a callback is registered is also a fairly stupid thing to do.

svn path=/trunk/; revision=49354
2013-05-16 23:38:31 +00:00
Evan Huus d860a01aaf Round two of wmem cleanup callbacks. While the emem tree behaviour will require
recurring callbacks, I suspect most other potential uses will be once-only, so
make that possible, and improve the documentation on the remaining issues.

Also separate out the code into its own files and the testing into its own
test case.

svn path=/trunk/; revision=49209
2013-05-08 01:14:01 +00:00
Evan Huus 2e92c6dfde Add user callbacks to wmem. This feature is a generic way to transparently mimic
the behaviour emem has for seasonal trees, which is that the master tree
structure is not actually seasonal - it is permanent. When the seasonal memory
pool is cleared, the root node pointer in all of these permanent trees is set
to NULL, and the pool takes care of actually freeing the nodes.

Wmem can now mimic this by allocating the tree header struct in epan_scope(),
allocating any node structs in file_scope(), and registering a callback on
file_scope() that NULLs the pointer in the epan_scope() header. Yes, this is
confusing, but it seemed simpler than adding manual callback registrations to
every single dissector that currently uses seasonal trees.

The callbacks may also be useful for other things that need cleanup (I'm
thinking resource handles stored in wmem memory that need to be fclosed or
what-have-you before they the handle is lost).

As indicated by the number of caveats in README.wmem, the implementation
probably needs a bit of work to make it safer/saner/more-useful. Thoughts
(or patches!) in this direction are more than welcome.

svn path=/trunk/; revision=49205
2013-05-07 19:23:10 +00:00
Evan Huus f19efd05f7 Remove singly-linked list from the wmem TODO list. Now that it has append
all of the really important stuff is there, and emem doesn't provide it at all
so it's not blocking migration.

svn path=/trunk/; revision=49103
2013-05-01 01:09:57 +00:00
Evan Huus 5deac1e6e1 Wmem string-buffer improvements:
- better tests
- fix a bug caught by the better tests
- implement append_c and append_unichar, with tests

Wmem string-buffers now have feature parity with their emem equivalents, so
remove them from the TODO list.

svn path=/trunk/; revision=49060
2013-04-26 21:30:24 +00:00
Evan Huus e8fc503c21 Summarize the API listing in the wmem README. Doxygen in the header files will
be much easier to keep in sync with the actual code.

svn path=/trunk/; revision=49040
2013-04-25 22:29:48 +00:00
Evan Huus 2a50c31800 Add a section to the wmem README about testing.
svn path=/trunk/; revision=48990
2013-04-22 21:29:57 +00:00
Evan Huus 8de4b82fcd Document the wmem override environment variable in the man pages, and improve
README.wmem in a couple of places.

svn path=/trunk/; revision=48251
2013-03-11 19:17:26 +00:00
Evan Huus aafe8b18e9 Remove the wmem slab. It was an optimization mimicking the emem slab
(removed in r48218) which did nothing particularly useful. Also lets us remove
another debugging environment variable.

svn path=/trunk/; revision=48219
2013-03-09 20:16:33 +00:00
Evan Huus 63313f0c70 Update wmem docs
svn path=/trunk/; revision=47549
2013-02-08 01:50:35 +00:00
Evan Huus 681a3ad5a2 Handle NULL-pointers and 0-lengths in a much simpler allocator-agnostic way,
and document the fact that allocator authors don't have to care.

svn path=/trunk/; revision=47220
2013-01-23 01:11:36 +00:00
Evan Huus 669b98bb5f Rewrite wmem_allocator_simple to track allocations using a GHashTable instead of
a GSList. This permits it to implement the new realloc and free functions. Also
fill in an empty gc function, since there isn't much it can do as far as
garbage-collection goes.

svn path=/trunk/; revision=47169
2013-01-19 19:56:20 +00:00
Evan Huus 21453d5db6 Add three more slots to the wmem allocater definition (not yet implemented
by any particular allocator) and better document the entire structure.

svn path=/trunk/; revision=47163
2013-01-19 16:15:32 +00:00
Evan Huus d0b774d0ea Minor documentation tweaks. Add a hash table to the wishlist.
svn path=/trunk/; revision=47101
2013-01-15 18:29:27 +00:00
Evan Huus bab105d094 Add convenience macros wmem_new and wmem_new0
svn path=/trunk/; revision=46941
2013-01-04 22:11:13 +00:00
Evan Huus a19980c23d Replace another instance of emem in README.developer with wmem.
svn path=/trunk/; revision=46847
2012-12-29 20:41:12 +00:00
Evan Huus 5eacf33f1f Update wmem documentation for the new allocator.
Use the strict allocator when fuzzing (at least until the fuzz-bot starts
running everything under valgrind).

svn path=/trunk/; revision=46829
2012-12-28 17:09:07 +00:00
Evan Huus 439eaf4aa5 Add documentation about the environment variable.
svn path=/trunk/; revision=46817
2012-12-27 22:57:05 +00:00
Evan Huus f88d8e48c1 Update wmem docs to include new type field.
svn path=/trunk/; revision=46815
2012-12-27 22:38:48 +00:00
Evan Huus 5ca70369a0 Add missing wmem strbuf routine to the documentation.
svn path=/trunk/; revision=46625
2012-12-19 23:12:58 +00:00
Evan Huus 3739c083bf Implement a basic singly-linked for wmem.
Re-implement the stack as a wrapper for that.

svn path=/trunk/; revision=46607
2012-12-19 01:37:28 +00:00
Evan Huus 5cf858ec52 Dispatch all allocator creations through a single function using an enum to
determine the desired type. This has two advantages over the old way:
 - just one environment variable for valgrind to override in order to guarantee
   that ALL allocators use memory it can track, and just one place to check that
   variable
 - allocator owners no longer have to include headers specific to their
   allocator, allowing them to change allocators without adjusting all their
   #includes

svn path=/trunk/; revision=46604
2012-12-19 00:43:36 +00:00
Evan Huus 8b69e3ee22 Use 'new' instead of 'create' a consistent manner.
svn path=/trunk/; revision=46601
2012-12-18 23:25:11 +00:00
Evan Huus 7f23c2f8b7 Recommend wmem over emem in the READMEs where possible.
svn path=/trunk/; revision=46472
2012-12-08 21:57:05 +00:00
Evan Huus d4261b289f Document the new pinfo pool, add a TODO list.
svn path=/trunk/; revision=46332
2012-12-02 17:16:09 +00:00
Evan Huus f4a786638b Add strdup_printf and strdup_vprintf to the wmem string utilities.
svn path=/trunk/; revision=46177
2012-11-25 14:16:50 +00:00
Evan Huus 0d1f86c33e Allocate wmem memory in blocks of 8MB, not 10, because powers of two are nice.
svn path=/trunk/; revision=46175
2012-11-25 13:58:06 +00:00
Evan Huus 67ea470cc8 Add the block allocator to the documentation.
svn path=/trunk/; revision=46169
2012-11-24 18:49:52 +00:00
Evan Huus ffd9a73b69 More wmem documentation.
svn path=/trunk/; revision=45989
2012-11-10 14:43:27 +00:00
Evan Huus c3ee061e59 Update wmem README to reflect the fact that wmem_file_scope() now works.
svn path=/trunk/; revision=45978
2012-11-09 00:10:21 +00:00
Evan Huus f28a5df5df More wmem documentation additions and updates. Still incomplete.
svn path=/trunk/; revision=45882
2012-11-03 17:58:07 +00:00
Evan Huus 7588f12291 Some documentation for wmem.
svn path=/trunk/; revision=45832
2012-10-30 01:24:16 +00:00