Fixing lalr on windows
This commit is contained in:
parent
69db2b82a4
commit
8cc5f2f9f7
15 changed files with 1276 additions and 1226 deletions
|
|
@ -145,13 +145,11 @@ namespace obj {
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef OBJECT_REF_COUNT
|
||||
ObjectMemHead* mh = NDO_MEMH_FROM_NDO(in);
|
||||
if (mh->refc > 1) {
|
||||
mh->refc--;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
NDO_CASTV(ClassObject, in, classobj);
|
||||
if (classobj) {
|
||||
|
|
@ -175,7 +173,6 @@ namespace obj {
|
|||
ObjectMemDeallocate(in);
|
||||
}
|
||||
|
||||
#ifdef OBJECT_REF_COUNT
|
||||
tp::halni objects_api::getrefc(Object* in) {
|
||||
ObjectMemHead* mh = NDO_MEMH_FROM_NDO(in);
|
||||
return (tp::halni) mh->refc;
|
||||
|
|
@ -190,7 +187,7 @@ namespace obj {
|
|||
ObjectMemHead* mh = NDO_MEMH_FROM_NDO(in);
|
||||
mh->refc = refc;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void hierarchy_copy(Object* self, const Object* in, const ObjectType* type) {
|
||||
if (type->base) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
namespace obj {
|
||||
|
||||
ObjectMemHead* bottom = nullptr;
|
||||
tp::ualni count = 0;
|
||||
|
||||
struct ObjectsFileHeader {
|
||||
char name[10] = { 0 };
|
||||
|
|
@ -33,16 +34,17 @@ namespace obj {
|
|||
memh->down = NULL;
|
||||
memh->flags = 0;
|
||||
|
||||
#ifdef OBJECT_REF_COUNT
|
||||
memh->refc = (tp::alni) 1;
|
||||
#endif
|
||||
|
||||
if (bottom) {
|
||||
bottom->down = memh;
|
||||
}
|
||||
|
||||
memh->up = bottom;
|
||||
bottom = memh;
|
||||
|
||||
count++;
|
||||
|
||||
NDO_FROM_MEMH(memh)->type = type;
|
||||
return NDO_FROM_MEMH(memh);
|
||||
}
|
||||
|
|
@ -61,6 +63,8 @@ namespace obj {
|
|||
}
|
||||
|
||||
tp::HeapAllocGlobal::deallocate(memh);
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
void logTypeData(const ObjectType* type) {
|
||||
|
|
@ -71,6 +75,8 @@ namespace obj {
|
|||
}
|
||||
}
|
||||
|
||||
tp::ualni getObjCount() { return count; }
|
||||
|
||||
void assertNoLeaks() {
|
||||
if (bottom) {
|
||||
printf("ERROR : not all objects are destroyed\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue