summaryrefslogtreecommitdiff
path: root/girepository
diff options
context:
space:
mode:
authorMaxim Ermilov <zaspire@rambler.ru>2010-01-25 00:26:29 +0300
committerMaxim Ermilov <zaspire@rambler.ru>2010-01-25 22:08:11 +0300
commitd02fa080445ebcea8b878dd496ec3f5affb59a64 (patch)
treecadb187a6e76e09ca64981d6080727370f59abc7 /girepository
parentbe00b8746769cf4ff8130df1b99cf976884fdde5 (diff)
downloadgobject-introspection-d02fa080445ebcea8b878dd496ec3f5affb59a64.tar.gz
increase limit of GIRealInfo's ref_count
New limit is 0x7FFFFFFF.
Diffstat (limited to 'girepository')
-rw-r--r--girepository/ginfo.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/girepository/ginfo.c b/girepository/ginfo.c
index ed2fc93d..76d60ef8 100644
--- a/girepository/ginfo.c
+++ b/girepository/ginfo.c
@@ -69,6 +69,8 @@ struct _GIUnresolvedInfo
const gchar *namespace;
};
+#define INVALID_REFCOUNT 0x7FFFFFFF
+
static void
g_info_init (GIRealInfo *info,
GIInfoType type,
@@ -80,7 +82,7 @@ g_info_init (GIRealInfo *info,
memset (info, 0, sizeof (GIRealInfo));
/* Invalid refcount used to flag stack-allocated infos */
- info->ref_count = 0xFFFF;
+ info->ref_count = INVALID_REFCOUNT;
info->type = type;
info->typelib = typelib;
@@ -110,7 +112,7 @@ g_info_new_full (GIInfoType type,
g_info_init (info, type, repository, container, typelib, offset);
info->ref_count = 1;
- if (container && ((GIRealInfo *) container)->ref_count != 0xFFFF)
+ if (container && ((GIRealInfo *) container)->ref_count != INVALID_REFCOUNT)
g_base_info_ref (info->container);
g_object_ref (info->repository);
@@ -170,7 +172,7 @@ g_base_info_ref (GIBaseInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo*)info;
- g_assert (rinfo->ref_count != 0xFFFF);
+ g_assert (rinfo->ref_count != INVALID_REFCOUNT);
((GIRealInfo*)info)->ref_count++;
return info;
@@ -181,12 +183,12 @@ g_base_info_unref (GIBaseInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo*)info;
- g_assert (rinfo->ref_count > 0 && rinfo->ref_count != 0xFFFF);
+ g_assert (rinfo->ref_count > 0 && rinfo->ref_count != INVALID_REFCOUNT);
rinfo->ref_count--;
if (!rinfo->ref_count)
{
- if (rinfo->container && ((GIRealInfo *) rinfo->container)->ref_count != 0xFFFF)
+ if (rinfo->container && ((GIRealInfo *) rinfo->container)->ref_count != INVALID_REFCOUNT)
g_base_info_unref (rinfo->container);
if (rinfo->repository)