COB header unknown variables uncovered

Everything related to the code /
Tout ce qui touche au code
Post Reply
Unavowed
Posts: 6
Joined: Sat Feb 07, 2009 2:22 pm

COB header unknown variables uncovered

Post by Unavowed » Sat Feb 07, 2009 2:47 pm

So I noticed that in scripts/cob.cpp four of the fields in the header are marked as unknown. I had a closer look and here's what I found:

- Unknown_0 is CodeLength in units of 32-bit words (i.e. it's the sum of the sizes of all functions)
- Unknown_1 is StaticVariableCount

Knowing CodeLength means you know exactly how much code to read, so you can make a private copy of the code for the SCRIPT class instead of keeping all the file data in memory and not freeing it afterwards

Knowing StaticVariableCount means that you can allocate the array of statics just once per environment instead of dynamically resizing vectors.

Hope this helps :-)

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Feb 07, 2009 3:45 pm

Wooow thanks a lot !!

This was really lacking :), with this we'll be able to speed up a bit our COB machine :D
=>;-D Penguin Powered

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests