TempleOSCDV4.06.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:47:19 +02:00
1 parent 6fe38d2d9d
commit b632ab9a4f
261 files changed
+6282 -5801

No files matched your search

+22 -22
View File
@@ -33,58 +33,58 @@ I64 HashEntrySize(CHashSrcSym *temph)
I64 HashEntrySize2(CHashSrcSym *temph)
{//Memory size of a std system hash entry.
CDbgInfo *dbg_info;
I64 result=MSize2(temph);
I64 res=MSize2(temph);
if (!(temph->type&HTT_DICT_WORD))
result+=MSize2(temph->str);
res+=MSize2(temph->str);
if (temph->type & HTG_SRC_SYM) {
result+=MSize2(temph->src_link);
result+=MSize2(temph->index);
result+=MSize2(temph->import_name);
result+=LinkedLstSize(temph->ie_lst);
res+=MSize2(temph->src_link);
res+=MSize2(temph->idx);
res+=MSize2(temph->import_name);
res+=LinkedLstSize(temph->ie_lst);
if (temph->type & (HTT_FUN | HTT_EXPORT_SYS_SYM))
result+=MSize2(temph->dbg_info);
res+=MSize2(temph->dbg_info);
if (temph->type & HTT_CLASS)
result+=MemberLstSize(temph);
res+=MemberLstSize(temph);
else if (temph->type & HTT_FUN) {
result+=MemberLstSize(temph);
res+=MemberLstSize(temph);
if (dbg_info=temph->dbg_info)
//This should be $LK,"MSize",A="MN:MSize"$() but it would crash on AOT .BIN.Z file funs.
result+=dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]
res+=dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]
-dbg_info->body[0];
} else if (temph->type&HTT_DEFINE_STR)
result+=MSize2(temph(CHashDefineStr *)->data);
res+=MSize2(temph(CHashDefineStr *)->data);
else if (temph->type & HTT_GLBL_VAR) {
result+=LinkedLstSize(temph(CHashGlblVar *)->dim.next);
res+=LinkedLstSize(temph(CHashGlblVar *)->dim.next);
if (!(temph(CHashGlblVar *)->flags&GVF_ALIAS))
result+=MSize2(temph(CHashGlblVar *)->data_addr);
res+=MSize2(temph(CHashGlblVar *)->data_addr);
if (temph(CHashGlblVar *)->fun_ptr)
result+=HashEntrySize2(temph(CHashGlblVar *)->fun_ptr
res+=HashEntrySize2(temph(CHashGlblVar *)->fun_ptr
-temph(CHashGlblVar *)->fun_ptr->ptr_stars_cnt);
}
} else if (temph->type & HTT_FILE)
result+=MSize2(temph(CHashGeneric *)->user_data0);
res+=MSize2(temph(CHashGeneric *)->user_data0);
else if (temph->type & HTT_MODULE &&
StrCmp(temph->str,KERNEL_MODULE_NAME))
result+=MSize2(temph(CHashGeneric *)->user_data0);
return result;
res+=MSize2(temph(CHashGeneric *)->user_data0);
return res;
}
I64 HashTableSize2(CHashTable *table)
{//Memory size of std system hash table and all entries.
I64 i,result=0;
I64 i,res=0;
CHashSrcSym *temph;
if (!table)
return 0;
for (i=0;i<=table->mask;i++) {
temph=table->body[i];
while (temph) {
result+=HashEntrySize2(temph);
res+=HashEntrySize2(temph);
temph=temph->next;
}
}
result+=MSize2(table->body);
result+=MSize2(table);
return result;
res+=MSize2(table->body);
res+=MSize2(table);
return res;
}
U0 MapFileWrite(CHashTable *h,U8 *map_name,U8 drv_let)