Hi Stevem

It would be nice to used ep_alloc0(). During DICOM export, I have may small ones (<10kB) and a few big ones. I like to treat all the same. Not using ep_alloc() I would need to figure out, where to properly release the memory, in (or after) a tap. I'm sure I can figure it out, but it will take some time.

It would be nice, if EMEM_PACKET_CHUNK_SIZE (10MB) is a minimum size, but if more is requested, more would be allocated. And I remove the >>2 in my code, without any side effects so far.

David

Stephen Fisher wrote:
On Mon, May 25, 2009 at 11:38:37PM +0200, David Aggeler wrote:

What's the suggested alternative to se_alloc()/ep_alloc()? I need more than 5 MB.

Do you need the memory to be automatically released by Wireshark? If not, use g_malloc(), which is GLib's version of malloc. Note that g_malloc will cause Wireshark to terminate if there is not enough memory available (so it won't return NULL). Use g_free() to free it. You CAN pass g_free() a NULL pointer - it will just ignore it.


Steve

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <[email protected]>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:[email protected]?subject=unsubscribe

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <[email protected]>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:[email protected]?subject=unsubscribe

Reply via email to