1 /* grcboxprivate.h: Reference counted data
3 * Copyright 2018 Emmanuele Bassi
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
31 #ifndef G_DISABLE_ASSERT
32 /* A "magic" number, used to perform additional integrity
33 * checks on the allocated data
40 gatomicrefcount ref_count
;
44 #ifndef G_DISABLE_ASSERT
49 #define G_BOX_MAGIC 0x44ae2bf0
51 /* Keep the two refcounted boxes identical in size */
52 G_STATIC_ASSERT (sizeof (GRcBox
) == sizeof (GArcBox
));
54 #define G_RC_BOX_SIZE sizeof (GRcBox)
55 #define G_ARC_BOX_SIZE sizeof (GArcBox)
57 gpointer
g_rc_box_alloc_full (gsize block_size
,