Commit graph

214 commits

Author SHA1 Message Date
Guy Harris
59155d1d1c Eliminate ep_strdup(), as it's no longer used.
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-19 01:49:24 +00:00
Guy Harris
59702234b9 Put back ep_alloc0(), accidentally deleted in the removal of the se_ stuff.
(The se_ stuff wasn't as contiguous as I thought.)

Also fix some comments to no longer refer to #defines for se_ stuff.

Change-Id: Ibc53e6f0f135bee9795f98550d5242e8e58afb16
Reviewed-on: https://code.wireshark.org/review/6641
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 22:17:19 +00:00
Guy Harris
7940bbc192 Nobody uses se_ allocations, so remove the code for them.
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-18 21:28:04 +00:00
Michael Mann
ef7e8aa065 Remove ep_strndup
Change-Id: Id336dc16f97a0973754993094aa637813c0ca31c
Reviewed-on: https://code.wireshark.org/review/6604
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-18 04:14:55 +00:00
Evan Huus
3f575120ea Kill more unused emem functions
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-16 17:36:15 +00:00
Evan Huus
0b271aa867 Remove ep_strbuf code
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-12 17:11:34 +00:00
Evan Huus
3a9869d81a Remove/replace ep_strsplit()
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>
2015-01-10 01:56:08 +00:00
Guy Harris
19b7819694 Get rid of unnecessary includes of ctype.h.
Change-Id: Ibb194cd839d174af9c96f7bb1e2941b3dd6c1ce1
Reviewed-on: https://code.wireshark.org/review/4797
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 23:31:20 +00:00
Bill Meier
a379ac74d2 Fix spelling: cant-->can't, wont-->won't, etc
Change-Id: Ia6c3e7a25615bf8e052c3bacf096d76df775c9c2
Reviewed-on: https://code.wireshark.org/review/4126
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-16 15:31:58 +00:00
Evan Huus
b166553279 remove more unused code
Change-Id: I7275aafe7d7216b85bbb34ba959b74358d102a91
Reviewed-on: https://code.wireshark.org/review/2255
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16 19:11:03 +00:00
Evan Huus
83f9cc6603 Remove last caller of se_strdup_printf
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-16 15:25:53 +00:00
Evan Huus
39a14ab75f Remove now-unused functions.
Change-Id: Iecf230d493b31ecab25b33c67323987459b23bd7
Reviewed-on: https://code.wireshark.org/review/2242
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16 15:19:48 +00:00
Evan Huus
4ca79e9de6 Remove some dead emem code.
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-05-11 15:36:11 +00:00
Alexis La Goutte
296591399f Remove all $Id$ from top of file
(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-03-04 14:27:33 +00:00
Evan Huus
c0a0805dcc Remove emem tree code entirely, it is unused.
Depends on I1cedc611c9b7888eb671cf858c6f7819d37afba9

Change-Id: I5dda2f7c34eacb6f350473791df1d74ea4b4a749
Reviewed-on: https://code.wireshark.org/review/220
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-02-16 04:48:10 +00:00
Evan Huus
18f94609d8 Remove now-unused ephemeral stack code. And another one bites the dust...
svn path=/trunk/; revision=54436
2013-12-24 03:39:19 +00:00
Jakub Zawadzki
62d05c80ff Fix some warnings
svn path=/trunk/; revision=54109
2013-12-14 22:07:26 +00:00
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
Jakub Zawadzki
ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Pascal Quantin
14fd3d0157 ZeroMemory -> SecureZeroMemory
svn path=/trunk/; revision=52731
2013-10-21 15:16:41 +00:00
Pascal Quantin
cf9bbdecef From RobiOneKenobi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9297 :
Add support for MSVC2013

svn path=/trunk/; revision=52716
2013-10-20 17:35:30 +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
Jakub Zawadzki
1cabad610b Add some very basic framework to fetch statistics of memory usage per component.
Use it in memory_dlg.

svn path=/trunk/; revision=51069
2013-07-31 18:26:14 +00:00
Chris Maynard
1c19a0d61e Fix warnings: format '%blah' expects argument of type 'foo', but argument 'i' has type 'bar' [-Wformat].
svn path=/trunk/; revision=50639
2013-07-15 21:22:34 +00:00
Evan Huus
e13d73e038 Rework wmem scoping limits so that users can still get a handle to a pool when
it is out of scope, they just can't *allocate* in the pool. This is necessary
because file-scope trees (migrating from emem) are set up on program
initialization when there is no file in scope - they need to initialize with the
handle, they just won't use it until a file is actually in scope.

svn path=/trunk/; revision=50046
2013-06-19 18:28:13 +00:00
Evan Huus
526763c293 Fix compilation with SHOW_EMEM_STATS defined.
svn path=/trunk/; revision=49252
2013-05-11 19:40:33 +00:00
Evan Huus
b7b30a7cdf More block allocator fixes and cleanup. Most of the issues seem to have been
from one case I consistently forgot when typing it up originally, even though
it's clearly listed several places in my design notes.

Also include an #if0-ed out block of code to redirect emem to wmem for easy
testing (since there are very few common dissectors that use wmem right now).

svn path=/trunk/; revision=48434
2013-03-20 00:04:01 +00:00
Anders Broman
39b85839b1 From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48311
2013-03-15 05:42:24 +00:00
Jakub Zawadzki
85f98b5cfc r30032 again, actually make emem_verify_pointer() works with glib chunks.
after allocating glib chunk, amount_free should be 0,
and free_offset should be set to chunk size.

svn path=/trunk/; revision=48233
2013-03-10 17:49:53 +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
Jeff Morriss
99ce4232cb As suggested in comments in sl_alloc() and sl_free(): add a new environment
variable (WIRESHARK_DEBUG_USE_SLICES) which turns off the slab allocator and uses
g_slices instead (which can themselves be turned off by setting
G_SLICE=always-malloc).

This makes debugging problems in slab-allocated memory easier to find
(hopefully including https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8197 ).


Set WIRESHARK_DEBUG_USE_SLICES when running Valgrind on *shark.


Remove unused structure member: emem_chunk_t.org.

svn path=/trunk/; revision=47110
2013-01-16 03:34:29 +00:00
Guy Harris
8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Anders Broman
f5226f1310 From Bill Parker:
Add error handler to munmap() failure in emem.c

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7850

svn path=/trunk/; revision=45915
2012-11-05 09:04:53 +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
Jakub Zawadzki
174dabeeca Fix r45445
svn path=/trunk/; revision=45446
2012-10-10 12:30:53 +00:00
Jakub Zawadzki
c24a90f49e Fix bug #7814
We need to pass original pointer and length to munmap().

svn path=/trunk/; revision=45445
2012-10-10 12:24:56 +00:00
Evan Huus
fd76b098a3 Temporarilly disable ep's use of chunks until the bugs are fixed.
svn path=/trunk/; revision=45444
2012-10-10 11:17:28 +00:00
Evan Huus
b01f1d3762 Actually destroy chunks in emem_free_all. We lose the efficiency of re-using
them, but until I can figure out the correct logic for that (3rd try and
counting...) this at least plugs the leak.

svn path=/trunk/; revision=45412
2012-10-08 22:27:03 +00:00
Evan Huus
693ed306d3 Try to clarify some of the ifdefs in emem.c.
svn path=/trunk/; revision=45404
2012-10-08 19:43:03 +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
Gerald Combs
98d7549953 We've already typedef'ed emem_header_t in emem.h. We don't have to do it
again in emem.c.

svn path=/trunk/; revision=45396
2012-10-08 17:52:42 +00:00
Evan Huus
7c5f2ec024 Write a short essay in a comment explaining the weirdness that is now the
ephemeral allocation logic.

svn path=/trunk/; revision=45392
2012-10-08 16:42:54 +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
Jeff Morriss
3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Jeff Morriss
42623443ed As suggested by Anatoly in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5699 :
Followup to r44844: use a better cast (intptr_t instead of long long).

svn path=/trunk/; revision=44880
2012-09-11 13:11:33 +00:00
Jeff Morriss
17e7db3bca Attempt to fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5699
and https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5979 : 

Don't cast the buffer address to int on Win32: a 64-bit address won't
fit in an integer.

svn path=/trunk/; revision=44844
2012-09-10 15:18:17 +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
Gerald Combs
5107d75c82 Try to fix a compiler warning.
svn path=/trunk/; revision=44408
2012-08-09 22:45:43 +00:00
Gerald Combs
097f33c41d Iterate over the emem_tree_*32_array key data instead of using
recursion. I've only done minimal testing but it seems to work OK.

svn path=/trunk/; revision=44401
2012-08-09 21:46:34 +00:00