Use a dynamically allocated STRUCT.

Since C does not define how structures and fields are laid out in
memory you have to manually unmarshall all individual fields and
assign them into that structure using helper functions such as
tvb_get_[le|n]toh[s|l|64]()





On 10/31/06, prashanth joshi <[EMAIL PROTECTED]> wrote:
> Hi,
>   Suppose we want to copy the contents from the tvb in to a buffer.
>   In that case is it better to use the array defined within the function or
> is it better to use a dynamically allocated array to copy the contents from
> the tvb. Can I free a memory allocated by g_malloc ( ) function, after the
> item is added to the display tree?
>   Regards,
>   Prashanth.
>
> Davide Schiera <[EMAIL PROTECTED]> wrote:
>   Sorry Jeff, you're right.
> I was trying the latest build found on
> http://www.wireshark.org/download/automated/win32/ (SVN-19748) and actually
> that version is quicker that 0.99.4pre2 (it takes 3 or 4 seconds to start
> up, while the prerelease takes at least -on my laptop- 15 seconds).
>
> Ciao,
>
>
> Davide
>
> DS> -----Messaggio originale-----
> DS> Da: [EMAIL PROTECTED]
> DS> [mailto:[EMAIL PROTECTED] Per conto di
> DS> Davide Schiera
> DS> Inviato: martedì 31 ottobre 2006 10.03
> DS> A: 'Developer support list for Wireshark'
> DS> Oggetto: [Wireshark-dev] R: 0.99.4pre2 taking a really long
> DS> time ininitdissectors?
> DS>
> DS> Hi,
> DS> in my case this version seems quicker that the previous one
> DS> (I had that problem since, I think, v0.99.3) when I saw the
> DS> problem you describe.
> DS> However, it seems to be a little slower in the "Open
> DS> file..." dialog box, when you change the selection from a
> DS> file to another one (maybe to get information about a file).
> DS>
> DS> Ciao,
> DS>
> DS>
> DS> Davide
> DS>
> DS> DS> -----Messaggio originale-----
> DS> DS> Da: [EMAIL PROTECTED]
> DS> DS> [mailto:[EMAIL PROTECTED] Per conto di Jeff
> DS> DS> Morriss
> DS> DS> Inviato: martedì 31 ottobre 2006 9.56
> DS> DS> A: Wireshark Development
> DS> DS> Oggetto: [Wireshark-dev] 0.99.4pre2 taking a really
> DS> long time in
> DS> DS> initdissectors?
> DS> DS>
> DS> DS>
> DS> DS> I'm trying out the new prerelease and I found that it
> DS> takes a little
> DS> DS> over 30 seconds to start Wireshark [my laptop is old,
> DS> but it's not
> DS> DS> *that* old!]. The Splash screen shows most of the time
> DS> spent in
> DS> DS> "Init dissectors" and Task Manager shows the CPU pegged
> DS> during this
> DS> DS> time.
> DS> DS>
> DS> DS> Interestingly, 'tshark' starts up pretty quickly.
> DS> DS>
> DS> DS>
> DS> DS> My install is standard except:
> DS> DS> - do not install SNMP MIBs
> DS> DS> - install MATE
> DS> DS>
> DS> DS> _______________________________________________
> DS> DS> Wireshark-dev mailing list
> DS> DS> [email protected]
> DS> DS> http://www.wireshark.org/mailman/listinfo/wireshark-dev
> DS> DS>
> DS>
> DS> _______________________________________________
> DS> Wireshark-dev mailing list
> DS> [email protected]
> DS> http://www.wireshark.org/mailman/listinfo/wireshark-dev
> DS>
>
> _______________________________________________
> Wireshark-dev mailing list
> [email protected]
> http://www.wireshark.org/mailman/listinfo/wireshark-dev
>
>
>
> ---------------------------------
>  Check out the New Yahoo! Mail - Fire up a more powerful email and get
> things done faster.
>
_______________________________________________
Wireshark-dev mailing list
[email protected]
http://www.wireshark.org/mailman/listinfo/wireshark-dev

Reply via email to