Wireshark-bugs: [Wireshark-bugs] [Bug 5879] New: Adding support for "destructors" to the ephemer

Date: Sun, 1 May 2011 15:31:59 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5879

           Summary: Adding support for "destructors" to the ephemeral
                    memory manager
           Product: Wireshark
           Version: SVN
          Platform: All
               URL: http://www.wireshark.org/lists/wireshark-dev/201105/ms
                    g00001.html
        OS/Version: Windows 7
            Status: NEW
          Severity: Enhancement
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: dmitrmax@xxxxxxxxx


Max Dmitrichenko <dmitrmax@xxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #6268|                            |review_for_checkin?
               Flag|                            |

Created an attachment (id=6268)
 --> (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=6268)
[PATCH] destructor support for ephemeral memory

Build Information:
Version 1.5.2 (SVN Rev Unknown from unknown)

Copyright 1998-2011 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled (64-bit) with GTK+ 2.22.1, with GLib 2.26.1, with WinPcap (version
unknown), with libz 1.2.5, without POSIX capabilities, without libpcre, without
SMI, with c-ares 1.7.1, with Lua 5.1, without Python, with GnuTLS 2.10.3, with
Gcrypt 1.4.6, without Kerberos, with GeoIP, with PortAudio V19-devel (built Apr
27 2011), with AirPcap.

Running on 64-bit Windows 7, build 7600, with WinPcap version 4.1.2 (packet.dll
version 4.1.0.2001), based on libpcap version 1.0 branch 1_0_rel0b (20091008),
GnuTLS 2.10.3, Gcrypt 1.4.6, without AirPcap.

Built using Microsoft Visual C++ 10.0 build 40219
--
On the wireshark-dev there was a discussion [1] about a callback mechanism for
ephemeral memory which is called just before ephemeral memory is freed, to
deallocate all additional non-ephemeral resources which the ephemeral memory
references to.

I've implemented such a mechanism. It costs one additional pointer per each
memory chunk allocated. Plus it costs thee additional pointers per allocation,
if
allocation is made from pool in 'use_chunks'-mode when destructor is used,
otherwise it costs nothing.

Callback is supplied as a parameter to allocation function. The only parameter
of the callback is a pointer to the memory which is being freed.

[1] http://www.wireshark.org/lists/wireshark-dev/201105/msg00001.html

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.