2 * Wireshark Memory Manager Misc Utilities
3 * Copyright 2013, Evan Huus <eapache@gmail.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include "wmem_core.h"
16 #include "wmem_miscutl.h"
19 wmem_memdup(wmem_allocator_t
*allocator
, const void *source
, const size_t size
)
26 dest
= wmem_alloc(allocator
, size
);
27 memcpy(dest
, source
, size
);
33 wmem_compare_int(const void *a
, const void *b
)
35 return GPOINTER_TO_INT(a
) - GPOINTER_TO_INT(b
);
39 wmem_compare_uint(const void *a
, const void *b
)
41 return GPOINTER_TO_UINT(a
) > GPOINTER_TO_UINT(b
) ? 1 : (GPOINTER_TO_UINT(a
) < GPOINTER_TO_UINT(b
) ? -1 : 0);
45 * Editor modelines - https://www.wireshark.org/tools/modelines.html
50 * indent-tabs-mode: nil
53 * vi: set shiftwidth=4 tabstop=8 expandtab:
54 * :indentSize=4:tabSize=8:noTabs=true: