aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-03-09 20:02:19 +0000
committerEvan Huus <eapache@gmail.com>2013-03-09 20:02:19 +0000
commit122b7cb6dfabd71a987216cf2fee907e8281dbd0 (patch)
tree9eca4481493ae05602a5d065e19f1c9daf8a427b /epan/ftypes
parentdeefa092378d5042c9f12edf1cd70563fa7d22b3 (diff)
Remove the emem slab feature (sl_* functions) completely, replacing it with
glib memory slices. - We weren't doing anything with the emem slab that couldn't be done with glib slices. - Removes a fair bit of code as well as one debugging environment variable. - Glib slices are much cache-friendlier and are multi-threading friendly (if we ever go there). - Allows glib to actually return slices to the OS on occasion. The emem slab would hold onto its memory forever which resulted in a great deal of wasted memory after closing a large file. svn path=/trunk/; revision=48218
Diffstat (limited to 'epan/ftypes')
-rw-r--r--epan/ftypes/ftypes.c6
-rw-r--r--epan/ftypes/ftypes.h4
2 files changed, 2 insertions, 8 deletions
diff --git a/epan/ftypes/ftypes.c b/epan/ftypes/ftypes.c
index 2a598f84bd..a8c7d127bf 100644
--- a/epan/ftypes/ftypes.c
+++ b/epan/ftypes/ftypes.c
@@ -31,10 +31,6 @@
/* Keep track of ftype_t's via their ftenum number */
static ftype_t* type_list[FT_NUM_TYPES];
-/* Space for quickly allocating/de-allocating fvalue_t's */
-struct ws_memory_slab fvalue_t_slab =
- WS_MEMORY_SLAB_INIT(fvalue_t, 128);
-
/* Initialize the ftype module. */
void
ftypes_initialize(void)
@@ -203,7 +199,7 @@ fvalue_new(ftenum_t ftype)
ftype_t *ft;
FvalueNewFunc new_value;
- fv = (fvalue_t *)sl_alloc(&fvalue_t_slab);
+ fv = g_slice_new(fvalue_t);
FTYPE_LOOKUP(ftype, ft);
fv->ftype = ft;
diff --git a/epan/ftypes/ftypes.h b/epan/ftypes/ftypes.h
index e873d49d7a..bdf969ba84 100644
--- a/epan/ftypes/ftypes.h
+++ b/epan/ftypes/ftypes.h
@@ -269,8 +269,6 @@ fvalue_init(fvalue_t *fv, ftenum_t ftype);
/* Free all memory used by an fvalue_t. With MSVC and a
* libwireshark.dll, we need a special declaration.
*/
-WS_DLL_PUBLIC struct ws_memory_slab fvalue_t_slab;
-
#define FVALUE_CLEANUP(fv) \
{ \
@@ -284,7 +282,7 @@ WS_DLL_PUBLIC struct ws_memory_slab fvalue_t_slab;
#define FVALUE_FREE(fv) \
{ \
FVALUE_CLEANUP(fv) \
- sl_free(&fvalue_t_slab, fv); \
+ g_slice_free(fvalue_t, fv); \
}
WS_DLL_PUBLIC