diff options
author | Evan Huus <eapache@gmail.com> | 2012-11-24 18:47:50 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2012-11-24 18:47:50 +0000 |
commit | ea7e8174c0c9b7e09deccce4c491af041362d4d6 (patch) | |
tree | 88421901c49f7fd2e86dacd72fa02890b46afb53 | |
parent | 8d784dcc466ae325b8372f5d5e9652158c1bd471 (diff) |
Reorder the wmem scopes to be ordered by lifetime, which makes more sense than
the old ordering.
svn path=/trunk/; revision=46168
-rw-r--r-- | epan/wmem/wmem_scopes.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/epan/wmem/wmem_scopes.c b/epan/wmem/wmem_scopes.c index 353d691696..c0160ea817 100644 --- a/epan/wmem/wmem_scopes.c +++ b/epan/wmem/wmem_scopes.c @@ -50,23 +50,13 @@ */ /* TODO: Make these thread-local */ -static wmem_allocator_t *epan_scope = NULL; static wmem_allocator_t *packet_scope = NULL; static wmem_allocator_t *file_scope = NULL; +static wmem_allocator_t *epan_scope = NULL; static gboolean in_packet_scope = FALSE; static gboolean in_file_scope = FALSE; -/* Epan Scope */ - -wmem_allocator_t * -wmem_epan_scope(void) -{ - g_assert(epan_scope); - - return epan_scope; -} - /* Packet Scope */ wmem_allocator_t * @@ -139,40 +129,50 @@ wmem_leave_file_scope(void) in_file_scope = FALSE; } +/* Epan Scope */ + +wmem_allocator_t * +wmem_epan_scope(void) +{ + g_assert(epan_scope); + + return epan_scope; +} + /* Scope Management */ void wmem_init_scopes(void) { - g_assert(epan_scope == NULL); g_assert(packet_scope == NULL); g_assert(file_scope == NULL); + g_assert(epan_scope == NULL); g_assert(in_packet_scope == FALSE); g_assert(in_file_scope == FALSE); - epan_scope = wmem_create_glib_allocator(); packet_scope = wmem_create_block_allocator(); file_scope = wmem_create_glib_allocator(); + epan_scope = wmem_create_glib_allocator(); } void wmem_cleanup_scopes(void) { - g_assert(epan_scope); g_assert(packet_scope); g_assert(file_scope); + g_assert(epan_scope); g_assert(in_packet_scope == FALSE); g_assert(in_file_scope == FALSE); - wmem_destroy_allocator(epan_scope); wmem_destroy_allocator(packet_scope); wmem_destroy_allocator(file_scope); + wmem_destroy_allocator(epan_scope); - epan_scope = NULL; packet_scope = NULL; file_scope = NULL; + epan_scope = NULL; } /* |