Wireshark mailing list archives

RFD: Slab allocator (sl_alloc()) related to r37112


From: Jakub Zawadzki <darkjames-ws () darkjames pl>
Date: Fri, 13 May 2011 12:00:03 +0200

Hi,

In r37027 I've commited basic slab allocator (based on macros from slab.h)

It's NOT thread safe allocator, but it should be good replacement for g_mem_chunk_alloc_*().
It might be also used as replacement for g_slice_*()

It has simillar function like g_mem_chunk to free all used memory (sl_free_all()).

I wanted to cleanup code like:
#if GLIB_CHECK_VERSION(2,10,0)
        ptr  = g_slice_new(...);
#else
        ptr = g_mem_chunk_alloc(...);
#endif
with single:
    ptr = sl_alloc(...);
sl_ allocator already passed multiple fuzz testing so it should be stable.

I know about near 1.6 release (and it looks like bigger change).
And maybe in 1.[78] we finally drop older glib release which would 
remove all g_mem_chunk_alloc().

Comments?
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: