forked from GitHub/gf-core
bugfixes related to old pointers
This commit is contained in:
@@ -1102,6 +1102,7 @@ fit:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
descr = ptr(block_descr, map);
|
||||||
int index = (descr->descr_txn_id != ms->curr_txn_id);
|
int index = (descr->descr_txn_id != ms->curr_txn_id);
|
||||||
descr->chain = free_descriptors[index];
|
descr->chain = free_descriptors[index];
|
||||||
free_descriptors[index] = map;
|
free_descriptors[index] = map;
|
||||||
|
|||||||
@@ -1183,7 +1183,7 @@ PgfRevision pgf_start_transaction(PgfDB *db, PgfExn *err)
|
|||||||
new_pgf->major_version = pgf->major_version;
|
new_pgf->major_version = pgf->major_version;
|
||||||
new_pgf->minor_version = pgf->minor_version;
|
new_pgf->minor_version = pgf->minor_version;
|
||||||
new_pgf->gflags = pgf->gflags;
|
new_pgf->gflags = pgf->gflags;
|
||||||
new_pgf->abstract.name = textdup_db(&(*pgf->abstract.name));
|
new_pgf->abstract.name = textdup_db(ref<PgfText>::from_ptr(&(*pgf->abstract.name)));
|
||||||
new_pgf->abstract.aflags = pgf->abstract.aflags;
|
new_pgf->abstract.aflags = pgf->abstract.aflags;
|
||||||
new_pgf->abstract.funs = pgf->abstract.funs;
|
new_pgf->abstract.funs = pgf->abstract.funs;
|
||||||
new_pgf->abstract.cats = pgf->abstract.cats;
|
new_pgf->abstract.cats = pgf->abstract.cats;
|
||||||
|
|||||||
@@ -92,6 +92,14 @@ ref<PgfText> textdup_db(PgfText *t1)
|
|||||||
return t2;
|
return t2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PGF_INTERNAL
|
||||||
|
ref<PgfText> textdup_db(ref<PgfText> t1)
|
||||||
|
{
|
||||||
|
ref<PgfText> t2 = PgfDB::malloc<PgfText>(t1->size+1);
|
||||||
|
memcpy(&(*t2), &(*t1), sizeof(PgfText)+t1->size+1);
|
||||||
|
return t2;
|
||||||
|
}
|
||||||
|
|
||||||
PGF_INTERNAL
|
PGF_INTERNAL
|
||||||
void text_db_release(ref<PgfText> text)
|
void text_db_release(ref<PgfText> text)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ PgfText* textdup(PgfText *t1);
|
|||||||
PGF_INTERNAL_DECL
|
PGF_INTERNAL_DECL
|
||||||
ref<PgfText> textdup_db(PgfText *t1);
|
ref<PgfText> textdup_db(PgfText *t1);
|
||||||
|
|
||||||
|
PGF_INTERNAL_DECL
|
||||||
|
ref<PgfText> textdup_db(ref<PgfText> t1);
|
||||||
|
|
||||||
PGF_INTERNAL
|
PGF_INTERNAL
|
||||||
void text_db_release(ref<PgfText> text);
|
void text_db_release(ref<PgfText> text);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user