summaryrefslogtreecommitdiff
path: root/epan/emem.h
AgeCommit message (Collapse)AuthorFilesLines
2015-02-04emem is dead! Long live wmem!Michael Mann1-118/+0
Change-Id: Iddd1200e62bf3200cb1a68408378dd9d47120b77 Reviewed-on: https://code.wireshark.org/review/6939 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-19Eliminate ep_strdup(), as it's no longer used.Guy Harris1-4/+0
Also, remove some no-longer-existent functions from checkAPIs.pl. Change-Id: I2bf11e3ec03a34f9e89d58d560e340d76fd3ddc1 Reviewed-on: https://code.wireshark.org/review/6645 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18Nobody uses se_ allocations, so remove the code for them.Guy Harris1-24/+0
Don't check for se_ routines in checkAPIs; the failure to compile or link will suffice to catch attempts to use them. Update comments in another test script to reflect the disappearance of the session allocator. Change-Id: If50d953c7130f48b696bc2dd9d327bea2af49bd4 Reviewed-on: https://code.wireshark.org/review/6638 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18Remove ep_strndupMichael Mann1-4/+0
Change-Id: Id336dc16f97a0973754993094aa637813c0ca31c Reviewed-on: https://code.wireshark.org/review/6604 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-17Replace all remaining instances of ep_new with wmem_new and wmem_packet_scope.Michael Mann1-1/+0
Change-Id: I50b2cd0e233554bc58082e96e8d879b40edfc0c1 Reviewed-on: https://code.wireshark.org/review/6595 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-16Kill more unused emem functionsEvan Huus1-10/+0
Change-Id: Ib81410b6d760886f2ae585f44ac58fc135da62c7 Reviewed-on: https://code.wireshark.org/review/6568 Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-12Remove ep_strbuf codeEvan Huus1-48/+0
Thanks to Michael's work, it is now totally unused. Change-Id: I67b5f7c69535a08f96f449c36c429e2548f4ea11 Reviewed-on: https://code.wireshark.org/review/6505 Petri-Dish: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-11Replace some "low hanging fruit" uses of emem.Michael Mann1-4/+0
Most of the remaining ep_ uses are grouped with specific functionality. Change-Id: I8fa64a17acc6bcdcf6891b2d28715ac0c58f1a4a Reviewed-on: https://code.wireshark.org/review/6484 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-10Remove/replace ep_strsplit()Evan Huus1-10/+0
Change-Id: I4a803d83844d937804849b2ad3b067381c9b96d0 Reviewed-on: https://code.wireshark.org/review/6448 Petri-Dish: Evan Huus <eapache@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-06Add printf-format annotations, fix garbagePeter Wu1-2/+3
The WRETH dissector showed up some garbage in the column display. Upon further inspection, it turns out that the format string had a trailing percent sign which caused (unsigned)-1 to be returned by g_printf_string_upper_bound (in emem_strdup_vprintf). Then ep_alloc is called with (unsigned)-1 + 1 = 0 memory, no wonder that garbage shows up. ASAN could not even catch this error because EP is in charge of this. So, start adding G_GNUC_PRINTF annotations in each header that uses the "fmt" or "format" paramters (grepped + awk). This revealed some other errors. The NCP2222 dissector was missing a format string (not a security vuln though). Many dissectors used val_to_str with a constant (but empty) string, these have been replaced by val_to_str_const. ASN.1 dissectors were regenerated for this. Minor: the mate plugin used "%X" instead of "%p" for a pointer type. The ncp2222 dissector and wimax plugin gained modelines. Change-Id: I7f3f6a3136116f9b251719830a39a7b21646f622 Reviewed-on: https://code.wireshark.org/review/2881 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16remove more unused codeEvan Huus1-36/+0
Change-Id: I7275aafe7d7216b85bbb34ba959b74358d102a91 Reviewed-on: https://code.wireshark.org/review/2255 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16Remove last caller of se_strdup_printfEvan Huus1-5/+0
Also remove that function as it is now unused. Fix what appeared to be a memory leak in the manual address resolution dialog while in the neighbourhood. Change-Id: I75128ab0f95e5a7673f92bfeea45191f00581c25 Reviewed-on: https://code.wireshark.org/review/2244 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16Remove now-unused functions.Evan Huus1-8/+0
Change-Id: Iecf230d493b31ecab25b33c67323987459b23bd7 Reviewed-on: https://code.wireshark.org/review/2242 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-11Remove some dead emem code.Evan Huus1-66/+0
Odds and ends that are no longer used anywhere in wireshark's codebase. It's slowly going away. Also internalize some code (remove header prototypes and make static) some functions that are only called internally to emem now. Change-Id: Ic1686a0f73c9ecaa333bc7b44a5a67a6a0369884 Reviewed-on: https://code.wireshark.org/review/1581 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-07Add a Qt I/O Graph dialog.Gerald Combs1-0/+8
For each graph you can set: - Its visibility - A name - A display filter - Color, from a fixed list - Plot style: Line, Impulse, Bar, Stacked Bar, Dot, Square, Diamond - Basic Y Axes (packets/s, bytes/s, bits/s) - Computed Y Axes (SUM, MIN, AVG, MAX) - Smoothing You can pan and zoom using the mouse and keyboard. Clicking on a graph selects the last packet for that interval. If all graphs have the same Y axis a single label is shown, otherwise a legend is shown. The time scale (X axis) can be toggled between relative seconds and the time of day. Graphs can be saved as PDF, PNG, BMP, and JPEG. Settings are "sticky" via the io_graphs UAT. To do: - Minimize graph drawing delays. - Figure out why smoothing differs from GTK+ - Everything else at the top of io_graph_dialog.cpp - Fix empty resets. A fair amount of code was copied from TCPStreamDialog. We might want to subclass QCustomPlot and place the shared code there. Move common syntax checking to SyntaxLineEdit. Move some common code from ui/gtk/io_stat.c to ui/io_graph_item.[ch] and use it in both GTK+ and Qt. Make the io_graph_item_t array allocation in io_stat.c static. The behavior should be identical and this gives us additional compile-time checks. Change-Id: I9a3d544469b7048f0761fdbf7bcf20f44ae76577 Reviewed-on: https://code.wireshark.org/review/435 Reviewed-by: Gerald Combs <gerald@wireshark.org> Tested-by: Gerald Combs <gerald@wireshark.org>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-02-16Remove emem tree code entirely, it is unused.Evan Huus1-95/+0
Depends on I1cedc611c9b7888eb671cf858c6f7819d37afba9 Change-Id: I5dda2f7c34eacb6f350473791df1d74ea4b4a749 Reviewed-on: https://code.wireshark.org/review/220 Reviewed-by: Michael Mann <mmann78@netscape.net>
2013-12-24Remove now-unused ephemeral stack code. And another one bites the dust...Evan Huus1-35/+0
svn path=/trunk/; revision=54436
2013-11-21Remove one accidentally remaining reference to emem in XMPP utils.Evan Huus1-93/+0
Kill a bunch of now-unused emem tree code. svn path=/trunk/; revision=53458
2013-09-04Remove some emem functions that have now been completely replaced by wmem.Evan Huus1-43/+0
Finally... svn path=/trunk/; revision=51757
2013-08-10Fix (-W)documentation error found by ClangAlexis La Goutte1-2/+0
../../epan/ftypes/../emem.h:34:3: error: empty paragraph passed to '@details' command [-Werror,-Wdocumentation] */ ^ svn path=/trunk/; revision=51278
2013-08-10Fix (-W)documentation error found by ClangAlexis La Goutte1-1/+1
../../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-03-28Include glib.h in emem.h, it needs the definitionsEvan Huus1-0/+2
svn path=/trunk/; revision=48630
2013-03-09Remove the emem slab feature (sl_* functions) completely, replacing it withEvan Huus1-23/+0
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-01Export libwireshark symbols using WS_DLL_PUBLIC defineBalint Reczey1-0/+48
Also remove old WS_VAR_IMPORT define and related Makefile magic everywhere in the project. svn path=/trunk/; revision=47992
2012-10-10Revert changes to ep_ allocator, revert edt ref-counting.Jakub Zawadzki1-5/+3
svn path=/trunk/; revision=45451
2012-10-08Rename emem_header_t to emem_pool_t to better indicate what it can beGuy Harris1-3/+3
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-08EDT structures now own their ep_ memory pools. This should finally cleanEvan Huus1-3/+5
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-06Vastly improve the debug presentation( of trees)+. Jaap Keuter1-0/+7
svn path=/trunk/; revision=45340
2012-08-18Convert GString to emem_strbuf_t in packet-gadu-gadu.cMichael Mann1-0/+10
Required an additional function, ep_strbuf_append_unichar, in emem module svn path=/trunk/; revision=44564
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-05-04The rest of the fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7221Jeff Morriss1-2/+14
(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
2011-11-20Get rid of Warnings.Anders Broman1-0/+2
svn path=/trunk/; revision=39957
2011-07-11More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versionsGerald Combs1-2/+0
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-05-09Initial commit of slab allocator (sl_* API) Jakub Zawadzki1-0/+22
svn path=/trunk/; revision=37027
2011-04-22As suggested by Jakub Zawadzki:Jeff Morriss1-1/+2
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-03-26Introduce ep_strconcat (copied from the glib version)Jeff Morriss1-0/+2
svn path=/trunk/; revision=36344
2010-08-29Doxygen changes.Anders Broman1-56/+64
svn path=/trunk/; revision=33990
2010-08-26Fix a number of doxygen directives.Anders Broman1-4/+4
svn path=/trunk/; revision=33930
2010-04-16Fix a few comment typosJeff Morriss1-11/+11
svn path=/trunk/; revision=32492
2010-02-07From Alex Lindberg via bug 4463:Stig Bjørlykke1-1/+15
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-01-25Changed from using own defined GNUC_FORMAT_CHECK to G_GNUC_PRINTFStig Bjørlykke1-6/+5
defined in GLib. Removed epan/gnuc_format_check.h. svn path=/trunk/; revision=31657
2010-01-25From Didier Gautheron via bug 4419:Stig Bjørlykke1-22/+23
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
2009-10-20Add emem_init() which initializes both the ep_ and se_ allocators; have allJeff Morriss1-8/+6
callers use that instead of initializing each allocator individually. svn path=/trunk/; revision=30646
2009-10-11Annotate with GNUC_FORMAT_CHECK()Kovarththanan Rajaratnam1-3/+5
svn path=/trunk/; revision=30489
2009-09-20Add ep_verify_pointer()/se_verify_pointer() which checks whether the given ↵Kovarththanan Rajaratnam1-3/+10
pointer belongs in the seasonal/ephemeral pool. svn path=/trunk/; revision=30011
2009-09-20Make se_trees static in emem.cKovarththanan Rajaratnam1-24/+18
svn path=/trunk/; revision=30008
2009-08-11We now expose the following environment variables:Kovarththanan Rajaratnam1-1/+1
* 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-04-14ep_strbuf: fix some bugs and additional changesBill Meier1-14/+22
-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-03-28Replace a lot of pointer tracking and some GStrings with emem_strbufs. AddGerald Combs1-0/+17
ep_strbuf_printf and ep_strbuf_append_c. svn path=/trunk/; revision=27873