Commit Graph

21 Commits

Author SHA1 Message Date
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 706211b642 Make the wmem scopes friendly to the valgrind script like emem is.
svn path=/trunk/; revision=46171
2012-11-24 19:02:05 +00:00
Evan Huus ea7e8174c0 Reorder the wmem scopes to be ordered by lifetime, which makes more sense than
the old ordering.

svn path=/trunk/; revision=46168
2012-11-24 18:47:50 +00:00
Evan Huus a4b164680b Add a simple block allocator to wmem (no canaries or anything yet) and use it
for packet-scope memory.

svn path=/trunk/; revision=46166
2012-11-24 18:42:56 +00:00
Evan Huus 9f03dfb42d Enter and leave wmem's file scope appropriately.
svn path=/trunk/; revision=45977
2012-11-09 00:08:27 +00:00
Evan Huus 82501433e3 Use const in wmem where possible.
svn path=/trunk/; revision=45976
2012-11-08 23:18:26 +00:00
Evan Huus 5d6b306391 Wmem stack implementation using the wmem slab implementation to allocate frames.
svn path=/trunk/; revision=45881
2012-11-03 17:34:28 +00:00
Evan Huus 2737b7b7d3 Add wmem scopes for packet and file lifetimes. The file lifetime scope isn't
yet initialized because I can't figure out where the enter() and leave() calls
should go - the obvious place in packet.c causes a lot of assertion errors.

svn path=/trunk/; revision=45879
2012-11-03 15:49:15 +00:00
Evan Huus 6ef55f30d8 Rename wmem_permanent_scope -> wmem_epan_scope to reflect the fact that it
is technically scoped to the library, not the process. It's also shorter :)

svn path=/trunk/; revision=45877
2012-11-03 15:08:00 +00:00
Evan Huus a02e765e00 Experimental slab allocator logic for wmem.
Thanks to Sébastien Tandel for the idea.

svn path=/trunk/; revision=45809
2012-10-27 15:35:32 +00:00
Evan Huus b464dcd888 Create init and cleanup functions for wmem as a whole.
Call them from epan_init() and epan_cleanup().
Expose a permanent wmem scope for allocations that should only be freed when
epan is done (which is *not* necessarily when the program finishes).

svn path=/trunk/; revision=45805
2012-10-27 02:42:05 +00:00
Evan Huus 2ea364607a Make the allocator destructor part of wmem_allocator_t. This avoids two
potential bugs:
 - calling the wrong destroy function on an allocator
 - a pool allocator forgetting to call free_all on itself in the destructor

Also, fix potential typedef redefinition warning in wmem_allocator_glib.h

svn path=/trunk/; revision=45804
2012-10-27 02:29:46 +00:00
Evan Huus e6639e035e Don't use g_slist_free_full() it needs a more recent GLIB than we officially
require.

svn path=/trunk/; revision=45781
2012-10-24 22:14:32 +00:00
Guy Harris 1340194a62 wmem_allocator_t is defined in wmem_core.h; redefining it elsewhere will
cause errors.

svn path=/trunk/; revision=45771
2012-10-24 18:38:55 +00:00
Guy Harris 1bc158e695 Include wmem_core.h to define the wmem_allocator_t typedef.
svn path=/trunk/; revision=45753
2012-10-24 05:52:55 +00:00
Guy Harris 7079f979c3 We're no longer defining the structure in a typedef definition, so we
don't want the typedef name after the structure definition.

svn path=/trunk/; revision=45752
2012-10-24 05:37:15 +00:00
Guy Harris 3e1dae3c8d Make it a little more like the Makefile.am for the ftypes subdirectory.
Get rid of reference to non-existent Custom.common file.

svn path=/trunk/; revision=45751
2012-10-24 05:30:14 +00:00
Guy Harris c1e2438551 Have wmem_core.h define the wmem_allocator_t typedef, with an incomplete
structure definition of struct _wmem_allocator_t; have wmem_allocator.h
give the complete structure definition.  That avoids complaints about
the typedef being redefined.

svn path=/trunk/; revision=45750
2012-10-24 05:21:43 +00:00
Evan Huus 4e3ddfc4c1 Fix autotools build - missed a few spots that needed updating for wmem.
svn path=/trunk/; revision=45748
2012-10-24 03:44:34 +00:00
Evan Huus 84cc3daa3b Basic skeleton for wmem.
https://www.wireshark.org/lists/wireshark-dev/201210/msg00178.html

svn path=/trunk/; revision=45746
2012-10-24 02:04:40 +00:00