Commit Graph

68 Commits

Author SHA1 Message Date
Evan Huus 123caff957 Remove one accidentally remaining reference to emem in XMPP utils.
Kill a bunch of now-unused emem tree code.

svn path=/trunk/; revision=53458
2013-11-21 00:18:12 +00:00
Evan Huus 14d589a0a7 Remove some emem functions that have now been completely replaced by wmem.
Finally...

svn path=/trunk/; revision=51757
2013-09-04 21:24:51 +00:00
Alexis La Goutte c67d8f40e6 Fix (-W)documentation error found by Clang
../../epan/ftypes/../emem.h:34:3: error: empty paragraph passed to '@details'
      command [-Werror,-Wdocumentation]
 */
  ^

svn path=/trunk/; revision=51278
2013-08-10 21:31:27 +00:00
Alexis La Goutte 7b4431903d Fix (-W)documentation error found by Clang
../../epan/emem.h:560:5: error: '@return' command used in a comment that is attached to a function returning void
      [-Werror,-Wdocumentation]
 * @return void
   ~^~~~~~~~~~~

svn path=/trunk/; revision=51253
2013-08-10 21:27:52 +00:00
Evan Huus d3fe183eba Include glib.h in emem.h, it needs the definitions
svn path=/trunk/; revision=48630
2013-03-28 21:19:58 +00:00
Evan Huus 122b7cb6df Remove the emem slab feature (sl_* functions) completely, replacing it with
glib memory slices.

- We weren't doing anything with the emem slab that couldn't be done with glib
  slices.
- Removes a fair bit of code as well as one debugging environment variable.
- Glib slices are much cache-friendlier and are multi-threading friendly (if
  we ever go there).
- Allows glib to actually return slices to the OS on occasion. The emem slab
  would hold onto its memory forever which resulted in a great deal of wasted
  memory after closing a large file.

svn path=/trunk/; revision=48218
2013-03-09 20:02:19 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Jakub Zawadzki f68020f1e1 Revert changes to ep_ allocator, revert edt ref-counting.
svn path=/trunk/; revision=45451
2012-10-10 19:05:30 +00:00
Guy Harris e6616b7c2f Rename emem_header_t to emem_pool_t to better indicate what it can be
used for - it represents a memory pool that parcels out memory from
larger allocated chunks (reducing the number of individual malloc-style
calls that are made) and that can be freed in its entirety.

svn path=/trunk/; revision=45400
2012-10-08 18:33:00 +00:00
Evan Huus b6f0d11c6f EDT structures now own their ep_ memory pools. This should finally clean
up the last little bits of:
- https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5284
- https://www.wireshark.org/lists/wireshark-dev/201208/msg00128.html

and possibly part of:
- https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7775

This is a fairly invasive change that required some funky work with linked
lists to avoid changing any of the public ep_* APIs, so if something breaks
blame me :)

svn path=/trunk/; revision=45389
2012-10-08 15:23:36 +00:00
Jaap Keuter c80ed42fc6 Vastly improve the debug presentation( of trees)+.
svn path=/trunk/; revision=45340
2012-10-06 14:35:59 +00:00
Michael Mann 493516fd6c Convert GString to emem_strbuf_t in packet-gadu-gadu.c
Required an additional function, ep_strbuf_append_unichar, in emem module

svn path=/trunk/; revision=44564
2012-08-18 19:20:31 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Jeff Morriss 06bb167824 The rest of the fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7221
(emem alignment problems on SPARC) :

Have emem use 8-byte alignment when we need it.

Since I can't seem to write code that which reliably (across GCC versions and
optimization levels) determines if 8-byte alignment is needed for doubles,
"when" is defined as "if we're compiling for a CPU other than i386."

Windows doesn't need a check because it's either i386 or 64-bit (x86_64 or
maybe ia64--both of which get 8-byte alignment from G_MEM_ALIGN).

(And, yes, all of this is ignoring the 16-byte alignment requirements of long
doubles.)

svn path=/trunk/; revision=42431
2012-05-04 21:56:32 +00:00
Anders Broman 62866c78a0 Get rid of Warnings.
svn path=/trunk/; revision=39957
2011-11-20 12:43:04 +00:00
Gerald Combs 49b92440de More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versions
in README.devloper. Remove g_gnuc.h since it's no longer needed. Remove
tvbuff_init(), tvbuff_cleanup(), reassemble_init(), and
reassemble_cleanup() since they were only used for older GLib versions
which didn't support GSlices. Assume we always support the "matches"
operator.

svn path=/trunk/; revision=37978
2011-07-11 20:32:19 +00:00
Jakub Zawadzki 99351cb0e3 Initial commit of slab allocator (sl_* API)
svn path=/trunk/; revision=37027
2011-05-09 08:55:35 +00:00
Jeff Morriss ecf8cbed34 As suggested by Jakub Zawadzki:
Rename g_gnuc_malloc.h to g_gnuc.h (since it contains non-malloc related
GNUC stuff).

Use G_GNUC_WARN_UNUSED_RESULT from glib instead of using warn_unused_result
directly.

svn path=/trunk/; revision=36825
2011-04-22 17:57:10 +00:00
Jeff Morriss 3161977bf8 Introduce ep_strconcat (copied from the glib version)
svn path=/trunk/; revision=36344
2011-03-26 02:39:04 +00:00
Anders Broman a009cc0605 Doxygen changes.
svn path=/trunk/; revision=33990
2010-08-29 10:47:38 +00:00
Anders Broman 1c2b3b0eb9 Fix a number of doxygen directives.
svn path=/trunk/; revision=33930
2010-08-26 15:24:49 +00:00
Jeff Morriss c1e3350a32 Fix a few comment typos
svn path=/trunk/; revision=32492
2010-04-16 15:05:42 +00:00
Stig Bjørlykke f57d6e2095 From Alex Lindberg via bug 4463:
Added se_tree_lookup32_array_le to emem.[ch].  This function is similar to
se_tree_lookup32_le already defined.

Updated README.binarytrees to reflect this added function and corrected minor
spelling issues.

svn path=/trunk/; revision=31812
2010-02-07 11:01:13 +00:00
Stig Bjørlykke 9092486f58 Changed from using own defined GNUC_FORMAT_CHECK to G_GNUC_PRINTF
defined in GLib.  Removed epan/gnuc_format_check.h.

svn path=/trunk/; revision=31657
2010-01-25 13:20:53 +00:00
Stig Bjørlykke 2b5f360066 From Didier Gautheron via bug 4419:
Use G_GNUC_MALLOC in emem.h declarations.

From me:
Check for valid G_GNUC_MALLOC from g_gnuc_malloc.h.

svn path=/trunk/; revision=31656
2010-01-25 12:50:42 +00:00
Jeff Morriss 78318b32ee Add emem_init() which initializes both the ep_ and se_ allocators; have all
callers use that instead of initializing each allocator individually.

svn path=/trunk/; revision=30646
2009-10-20 17:43:05 +00:00
Kovarththanan Rajaratnam 88186e9b5a Annotate with GNUC_FORMAT_CHECK()
svn path=/trunk/; revision=30489
2009-10-11 06:22:55 +00:00
Kovarththanan Rajaratnam 1a61b42e8a Add ep_verify_pointer()/se_verify_pointer() which checks whether the given pointer belongs in the seasonal/ephemeral pool.
svn path=/trunk/; revision=30011
2009-09-20 12:02:40 +00:00
Kovarththanan Rajaratnam 42b01b61ab Make se_trees static in emem.c
svn path=/trunk/; revision=30008
2009-09-20 09:28:55 +00:00
Kovarththanan Rajaratnam e0e33ca74b We now expose the following environment variables:
* WIRESHARK_DEBUG_EP_NO_CHUNKS
 * WIRESHARK_DEBUG_SE_NO_CHUNKS
 * WIRESHARK_DEBUG_EP_NO_CANARY
 * WIRESHARK_DEBUG_SE_NO_CANARY

This allows us to enable/disable memory chunks and canaries at runtime _without_ needing to recompile.

svn path=/trunk/; revision=29375
2009-08-11 09:24:56 +00:00
Bill Meier fdda6e8778 ep_strbuf: fix some bugs and additional changes
-Bugs
  * str->len not set correctly in some cases;
  * trailing '\0' not always accounted for;
  * (issues relating to determining when & how much 
     to expand string buffer).
-Other
  * Change append, append_c, truncate to return 
    pointer to ep_strbuf (similar to the corresponding
    GString functions);
  * Rename certain variables to clarify usage (as I understand
    the intended usage);
  * ep_strbuf_grow: use current allocated length and not current
    string length as the starting point;
  * Optimizations;
  * Add some additional comments to emem.h ep_strbuf section

  * Use consistent indentation throughout emem.c;

svn path=/trunk/; revision=28044
2009-04-14 14:08:19 +00:00
Gerald Combs 21e87a963f Replace a lot of pointer tracking and some GStrings with emem_strbufs. Add
ep_strbuf_printf and ep_strbuf_append_c.

svn path=/trunk/; revision=27873
2009-03-28 00:27:03 +00:00
Gerald Combs 446d43351c Add initial support for string buffers - ep_allocated, growable strings
similar to GLib's GStrings. Use them to create the list of TCP flags.

svn path=/trunk/; revision=27872
2009-03-27 23:05:37 +00:00
Bill Meier ea2d615dd7 Fix some typos and spelling (mostly in text strings)
svn path=/trunk/; revision=27068
2008-12-20 01:01:28 +00:00
Luis Ontanon 230d917776 Add a debug helper for EP memory corruption
if compiled in and the env var WIRESHARK_DEBUG_EP_CANARY is set:
will check for canary integrity at every call to EP_CHECK_CANARY()
if corruption is found it exits pronting the prior location and the location in which corruption was found.
Hopefully it stops running while the corruptor is still in the stack.

see EP_CHECK_CANARY() calls in packet.c as an example.




svn path=/trunk/; revision=25927
2008-08-05 02:23:35 +00:00
Guy Harris 9e6329860a Fix some warnings - declare some arguments, variables, and structure
members to be const pointers when that's possible, and throw in some
casts when the GLib API fails to have properly consted arguments.

Use ep_strdup_printf() in some cases.

svn path=/trunk/; revision=25596
2008-06-25 03:05:19 +00:00
Ronnie Sahlberg b153578afa rework how emem trees indexed by strings so that traversing the tree
will traverse the entries in the lexical order of the key.

add a flag to lookup/insert for strings to specify whether a case 
insensitive key should be used instead of a (default) case sensitive 
key.


svn path=/trunk/; revision=23736
2007-12-04 03:26:50 +00:00
Ronnie Sahlberg c20bb13d67 for nested trees, teach emem about which nodes contain a pointer to a
subtree and which nodes that contain a pointer to user data

teach emem to be able to traverse nested trees


svn path=/trunk/; revision=23733
2007-12-04 01:44:05 +00:00
Ronnie Sahlberg 60c561e2bd add tree traversal functions
svn path=/trunk/; revision=23725
2007-12-03 22:47:23 +00:00
Guy Harris b98d651b21 In calls to the emem_tree routines, forcibly align items not known to be
aligned on 32-bit boundaries.

svn path=/trunk/; revision=21611
2007-04-28 21:09:20 +00:00
Guy Harris 1bc049906a Add some GCC warnings to the standard set, and add some others to the
--enable-extra-gcc-checks set.

If we turn on -pedantic, try turning on -Wno-long-long as well, so that
it's not *so* pedantic that it rejects the 64-bit integral data types
that we explicitly require.

Constify a bunch of stuff, and make some other changes, to get rid of
warnings.

Clean up some indentation.

svn path=/trunk/; revision=21526
2007-04-23 10:59:26 +00:00
Stephen Fisher 509883e3e9 From Doug Pratley:
The purpose of the patch is to provide a new output format (so it is
independent of -V): single line record per-packet with the fields chosen by the
user, with configuration options to control separator, quoting and whether a
header line is printed. It also extends some existing options behaviour (-c and
-a:filesize) so that they affect reading a file as well as writing one, so that
only the first <n> packets or bytes are read).


svn path=/trunk/; revision=21211
2007-03-26 20:17:05 +00:00
Ronnie Sahlberg 14810dd30c fix so that tcp.pdu.time works again.
it broken in one of the previous bugfixes to tcp

add a function to print an emem tree to the console for easier emem tree debugging


svn path=/trunk/; revision=19877
2006-11-11 22:39:25 +00:00
Ronnie Sahlberg 2fdf0e4b4b add trees with PErmanent allocation scope which will be useful for constructing
associative arrays for globally unique and persistent mappings such as
oid to name
sid to name
guid to name


svn path=/trunk/; revision=18937
2006-08-17 08:17:48 +00:00
Ronnie Sahlberg 2657b9b701 make creation of subtrees used for the _array tree type use the same allocation scope as its parent and thus become allocation scope agnostic
change all accessor functions to be defines to the emem_tree_ functions.



now   to create a tree with a different scope we only need to create a new
..._tree_create() function   and set up the appropriate defines


(it was a mistake to call the functions   se_tree_create   and se_tree_create_non_persistent,     they should be the other way around    i.e.  se_tree_create_persistent   and se_tree_create )



svn path=/trunk/; revision=18895
2006-08-14 09:36:15 +00:00
Ronnie Sahlberg 8ce8e719e0 rename some structures and defines from the se_tree to the emem_tree prefix
svn path=/trunk/; revision=18894
2006-08-14 08:29:29 +00:00
Ronnie Sahlberg 8529abb69b put a memory allocator function pointer inside the tree structure so that all accessor functions become storage scope agnostic
svn path=/trunk/; revision=18888
2006-08-12 23:27:22 +00:00
Anders Broman 996d4db495 Ethereal->Wireshark
svn path=/trunk/; revision=18234
2006-05-28 19:49:07 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Guy Harris 25bead5edf Not all compilers support unnamed struct/union fields within
structs/unions (GCC supports it "for compatibility with other
compilers"; presumably that's not for compatibility with the version of
Sun C that rejected it - was that a PCCism?).

svn path=/trunk/; revision=18072
2006-05-02 18:02:08 +00:00