This is an efficient string storage for short strings without heap allocations, and falling back to the heap for bigger allocations. Almost all structure fields and structure names in use nowadays are short enough to not require a heap allocation. As structure names and fields are sometimes dynamically created, storing them in a GQuark can create a memory leak and potentially a DoS attack by continously triggering creating of new quarks. Thanks to Tim for coming up with the name! Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432>
23 lines
889 B
C
23 lines
889 B
C
/* GStreamer
|
|
*
|
|
* Copyright (C) 2024 Sebastian Dröge <sebastian@centricular.com>
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Library General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Library General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Library General Public
|
|
* License along with this library; if not, write to the
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
* Boston, MA 02110-1301, USA.
|
|
*/
|
|
|
|
#define GST_ID_STR_DISABLE_INLINES
|
|
#include "gstidstr.c"
|