Type Headers

BlitzMax Forums/BlitzMax Programming/Type Headers

N(Posted 2005) [#1]
Could someone elaborate on what exactly is in the type header?

From what I can gather, it's four bytes, so is it, for example, just one byte for a chunk ID and then three more bytes for the contents? What's in these things?

There's probably some way to find it by going through Mark's C code, but I don't particularly feel like doing that as it's not a very pleasant thing to do.


skidracer(Posted 2005) [#2]
I don't see what is so unpleasant about loading the file brl.mod/blitz.mod/blitzobject.h, but to save you the pain, there is a class pointer and a reference count:

struct BBObject{
	//extends BBGCMem
	BBClass*	clas;
	int		refs;
};



marksibly(Posted 2005) [#3]
Hey, not everyone can work out my convoluted C code!

But yeah, it's currently 8 bytes - 4 for the 'type', 4 for the reference count.


N(Posted 2005) [#4]
skidracer: Unlike you, I don't know what's in what, so I'd have to check each and every file in an attempt to figure out what's what.

Secondly, chances are I wouldn't have recognized that structure as the Type header.

Mark: It's not much worse than mine in terms of readability, I just have no idea what is what in it. Aside from that slicing code I messed with. I did figure out what that was.


skidracer(Posted 2005) [#5]
Sorry, I suppose I'm the sort of person who enjoys learning new things by exploring every nook and cranny. I also try and say thanks when someone helps me out...


N(Posted 2005) [#6]
Oh, right, thanks.

As for enjoying learning new things, that's one of my hobbies, but I don't think I'm going to learn something just by staring at Mark's code -- I'd actually have to know what's going on in the first place.


Sarge(Posted 2005) [#7]
For a non c or c++ user i have no problem understanding the file order and what is inside them they look pretty organized and readable to me. I would just like to say all of you have done a brilliant job with blitzmax and to keep up the good work.