예제 #1
0
int main()
{
    obj herb;
    obj_setid(&herb, 33);
    int *pj = 0; 
    std::cout << obj_size() << std::endl;
    std::cout << obj_getid(&herb, pj) << std::endl;
    return 0;
}
예제 #2
0
파일: debug.c 프로젝트: chazu/btmux
static int
debug_check_stuff(void *key, void *data, int depth, void *arg)
{
	const dbref key_val = (dbref)key;
	XCODE *const xcode_obj = data;

	int osize, size;
	MAP *map;

	osize = size = SpecialObjects[xcode_obj->type].datasize;

	switch (xcode_obj->type) {
	case GTYPE_MAP:
		map = (MAP *)xcode_obj;
		if(map->map) {
			size += sizeof(map->map[0][0]) * map->map_width * map->map_height;
			size += bit_size(map);
			size += obj_size(map);
			size += mech_size(map);
		}
		break;

	default:
		break;
	}

	if(smallest[xcode_obj->type] < 0 || size < smallest[xcode_obj->type])
		smallest[xcode_obj->type] = size;
	if(largest[xcode_obj->type] < 0 || size > largest[xcode_obj->type])
		largest[xcode_obj->type] = size;
	total[xcode_obj->type] += size;
	number[xcode_obj->type]++;

	if(cheat_player > 0)
		notify_printf(cheat_player, "#%5d: %10s %5d", key_val,
		              SpecialObjects[xcode_obj->type].type, xcode_obj->type == GTYPE_AUTO ? ((AUTO *)xcode_obj)->mymechnum : 0 );

	return 1;
}
예제 #3
0
 size_t obj_size_in_words(HeapWord* addr) const { return obj_size(addr); }
예제 #4
0
 // Synonyms for the above.
 size_t obj_size_in_words(oop obj) const { return obj_size((HeapWord*)obj); }