Re: destruct and clone

This is a discussion on Re: destruct and clone within the SNMP Coders forums, part of the Networking and Network Related category; On ons, 2008-02-27 at 09:05 +0100, Magnus Fromreide wrote: > I have attached a first version of ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-04-2008
Magnus Fromreide
 
Posts: n/a
Default Re: destruct and clone


On ons, 2008-02-27 at 09:05 +0100, Magnus Fromreide wrote:
> I have attached a first version of destruct and clone for
> netsnmp_mib_handlers in order to demonstrate the concept.
>
> I would really like to get comments on it.
>
> The patch do incidentally fix a memory leak in the agent, and there are
> more similar low hanging fruit available.


Now I have looked further.

It seems as if the only places that tries to duplicate
netsnmp_mib_handler's inside of our tree are the injectHandler handling
and the range registration support.

The injectHandler case is worked around by the simple act of noticing
that none of the injectHandler handlers have any myvoid-data so the
myvoid field is simply not copied.

Thus the only remaining problem site is the handling of rage
registrations.

Now, as I see it the problem stems from the fact that the various
structures try to do to much.

An netsnmp_mib_handler have the fields

handler_name, myvoid(possibly), flags(partially), and access_method

that describe what it is to do. These could just as well be shared
between all instances of the handler and they could also be constant.

The netsnmp_mib_handler also have the fields

myvoid(possibly), flags(partially), next and prev

that describe how it should be handled for a certain instance, these are
the fields that force the duplication of the handler for each instance.

The struct could of course not be split since that would brek backwards
compatibility.

/MF


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:49 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0