Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-11-03 Thread Evan Huus
On Sun, Oct 28, 2012 at 10:12 AM, Evan Huus wrote: > On Sat, Oct 27, 2012 at 3:09 PM, Evan Huus wrote: >> On Sat, Oct 27, 2012 at 2:17 PM, Dirk Jagdmann wrote: General thoughts from the list on whether or not this would be a good idea? >>> >>> some general comments on the whole wmem idea: >

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-29 Thread Evan Huus
On Mon, Oct 29, 2012 at 5:56 PM, Jakub Zawadzki wrote: > Hi Evan, > > On Sun, Oct 28, 2012 at 07:45:10PM -0400, Evan Huus wrote: >> Tangentially, I haven't noticed if you've checked in a pinfo memory >> scope yet or not. Is there anything else wmem needs to be able to do >> for that to work or did

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-29 Thread Jakub Zawadzki
Hi Evan, On Sun, Oct 28, 2012 at 07:45:10PM -0400, Evan Huus wrote: > Tangentially, I haven't noticed if you've checked in a pinfo memory > scope yet or not. Is there anything else wmem needs to be able to do > for that to work or did you end up going in a different direction? I need some spare t

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-28 Thread Evan Huus
On Sun, Oct 28, 2012 at 7:26 PM, Jakub Zawadzki wrote: > On Sun, Oct 28, 2012 at 10:12:41AM -0400, Evan Huus wrote: >> We might be able to fake the proper scoping using thread-local globals >> if we wrap everything in functions that assert the state of a >> dissection. Something like: >> >> __thre

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-28 Thread Jakub Zawadzki
On Sun, Oct 28, 2012 at 10:12:41AM -0400, Evan Huus wrote: > We might be able to fake the proper scoping using thread-local globals > if we wrap everything in functions that assert the state of a > dissection. Something like: > > __thread wmem_allocator_t *packet_scope; > __thread gboolean packet_

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-28 Thread Evan Huus
On Sat, Oct 27, 2012 at 3:09 PM, Evan Huus wrote: > On Sat, Oct 27, 2012 at 2:17 PM, Dirk Jagdmann wrote: >>> General thoughts from the list on whether or not this would be a good idea? >> >> some general comments on the whole wmem idea: >> memory allocation is done almost everywhere in Wireshark

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-27 Thread Evan Huus
On Sat, Oct 27, 2012 at 2:17 PM, Dirk Jagdmann wrote: >> General thoughts from the list on whether or not this would be a good idea? > > some general comments on the whole wmem idea: > memory allocation is done almost everywhere in Wireshark, also in somewhat > hidden places. For example all the p

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-27 Thread Dirk Jagdmann
> General thoughts from the list on whether or not this would be a good idea? some general comments on the whole wmem idea: memory allocation is done almost everywhere in Wireshark, also in somewhat hidden places. For example all the proto_tree_add_* functions will need to allocate memory. It will

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-26 Thread Sébastien Tandel
On Fri, Oct 26, 2012 at 2:36 PM, Evan Huus wrote: > On Fri, Oct 26, 2012 at 12:14 PM, Sébastien Tandel > wrote: > > > > > > On Fri, Oct 26, 2012 at 1:58 PM, Evan Huus wrote: > >> > >> On Fri, Oct 26, 2012 at 11:40 AM, Graham Bloice > >> wrote: > >> > > >> > On 26 October 2012 14:44, Evan Huus

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-26 Thread Evan Huus
On Fri, Oct 26, 2012 at 12:14 PM, Sébastien Tandel wrote: > > > On Fri, Oct 26, 2012 at 1:58 PM, Evan Huus wrote: >> >> On Fri, Oct 26, 2012 at 11:40 AM, Graham Bloice >> wrote: >> > >> > On 26 October 2012 14:44, Evan Huus wrote: >> >> >> >> On Fri, Oct 26, 2012 at 9:29 AM, Sébastien Tandel >>

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-26 Thread Sébastien Tandel
On Fri, Oct 26, 2012 at 1:58 PM, Evan Huus wrote: > On Fri, Oct 26, 2012 at 11:40 AM, Graham Bloice > wrote: > > > > On 26 October 2012 14:44, Evan Huus wrote: > >> > >> On Fri, Oct 26, 2012 at 9:29 AM, Sébastien Tandel > >> wrote: > >> > > >> > > >> > On Wed, Oct 24, 2012 at 11:13 AM, Evan Hu

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-26 Thread Evan Huus
On Fri, Oct 26, 2012 at 11:40 AM, Graham Bloice wrote: > > On 26 October 2012 14:44, Evan Huus wrote: >> >> On Fri, Oct 26, 2012 at 9:29 AM, Sébastien Tandel >> wrote: >> > >> > >> > On Wed, Oct 24, 2012 at 11:13 AM, Evan Huus wrote: >> >> >> >> On Wed, Oct 24, 2012 at 8:10 AM, Sébastien Tandel

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-26 Thread Graham Bloice
On 26 October 2012 14:44, Evan Huus wrote: > On Fri, Oct 26, 2012 at 9:29 AM, Sébastien Tandel > wrote: > > > > > > On Wed, Oct 24, 2012 at 11:13 AM, Evan Huus wrote: > >> > >> On Wed, Oct 24, 2012 at 8:10 AM, Sébastien Tandel > >> wrote: > >> > > >> > > >> > On Wed, Oct 24, 2012 at 1:10 AM, G

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-26 Thread Evan Huus
On Fri, Oct 26, 2012 at 9:29 AM, Sébastien Tandel wrote: > > > On Wed, Oct 24, 2012 at 11:13 AM, Evan Huus wrote: >> >> On Wed, Oct 24, 2012 at 8:10 AM, Sébastien Tandel >> wrote: >> > >> > >> > On Wed, Oct 24, 2012 at 1:10 AM, Guy Harris wrote: >> >> >> >> >> >> On Oct 18, 2012, at 6:01 PM, Ev

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-26 Thread Sébastien Tandel
On Wed, Oct 24, 2012 at 11:13 AM, Evan Huus wrote: > On Wed, Oct 24, 2012 at 8:10 AM, Sébastien Tandel > wrote: > > > > > > On Wed, Oct 24, 2012 at 1:10 AM, Guy Harris wrote: > >> > >> > >> On Oct 18, 2012, at 6:01 PM, Evan Huus wrote: > >> > >> > I have linked a tarball [2] containing the fol

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-25 Thread Pascal Quantin
Le 25/10/2012 22:10, Evan Huus a écrit : > On Thu, Oct 25, 2012 at 4:00 PM, Jeff Morriss > wrote: >> Evan Huus wrote: >>> On Thu, Oct 25, 2012 at 2:05 PM, Jeff Morriss >>> wrote: Evan Huus wrote: > The usage might look something like this: > > wmem_allocator_t *ep_scope = wmem_c

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-25 Thread Evan Huus
On Thu, Oct 25, 2012 at 4:00 PM, Jeff Morriss wrote: > Evan Huus wrote: >> >> On Thu, Oct 25, 2012 at 2:05 PM, Jeff Morriss >> wrote: >>> >>> Evan Huus wrote: The usage might look something like this: wmem_allocator_t *ep_scope = wmem_create_glib_allocator(); doWork(ep_sc

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-25 Thread Jeff Morriss
Evan Huus wrote: On Thu, Oct 25, 2012 at 2:05 PM, Jeff Morriss wrote: Evan Huus wrote: The usage might look something like this: wmem_allocator_t *ep_scope = wmem_create_glib_allocator(); doWork(ep_scope); wmem_destroy_glib_allocator(ep_scope); and then in doWork, instead of ep_alloc(numByte

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-25 Thread Evan Huus
On Thu, Oct 25, 2012 at 2:05 PM, Jeff Morriss wrote: > Evan Huus wrote: >> >> The usage might look something like this: >> >> wmem_allocator_t *ep_scope = wmem_create_glib_allocator(); >> doWork(ep_scope); >> wmem_destroy_glib_allocator(ep_scope); >> >> and then in doWork, instead of ep_alloc(numB

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-25 Thread Jeff Morriss
Evan Huus wrote: The usage might look something like this: wmem_allocator_t *ep_scope = wmem_create_glib_allocator(); doWork(ep_scope); wmem_destroy_glib_allocator(ep_scope); and then in doWork, instead of ep_alloc(numBytes) you would call wmem_alloc(ep_scope, numBytes). Hopefully stupid ques

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-24 Thread Evan Huus
On Wed, Oct 24, 2012 at 8:10 AM, Sébastien Tandel wrote: > > > On Wed, Oct 24, 2012 at 1:10 AM, Guy Harris wrote: >> >> >> On Oct 18, 2012, at 6:01 PM, Evan Huus wrote: >> >> > I have linked a tarball [2] containing the following files: >> > - wmem_allocator.h - the definition of the allocator i

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-23 Thread Evan Huus
On Tue, Oct 23, 2012 at 11:10 PM, Guy Harris wrote: > > On Oct 18, 2012, at 6:01 PM, Evan Huus wrote: > >> I have linked a tarball [2] containing the following files: >> - wmem_allocator.h - the definition of the allocator interface >> - wmem_allocator_glib.* - a simple implementation of the allo

Re: [Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-23 Thread Guy Harris
On Oct 18, 2012, at 6:01 PM, Evan Huus wrote: > I have linked a tarball [2] containing the following files: > - wmem_allocator.h - the definition of the allocator interface > - wmem_allocator_glib.* - a simple implementation of the allocator > interface backed by g_malloc and a singly-linked lis

[Wireshark-dev] RFD: The Future of Memory Management in Wireshark

2012-10-18 Thread Evan Huus
TL;DR - Jakub recently proposed a few changes to emem [1]. While I think they are a very good idea, I believe that in the long term the current emem design has too many fundamental limitations to make it worth adapting for our future needs. I propose that it should be gradually deprecated in favour