comparison runtime/object.c @ 63:04baa003de5a

Merged latest changes with better C branch
author Mike Pavone <pavone@retrodev.com>
date Wed, 05 May 2010 22:12:23 -0400
parents b218af069da7 3e20ed8959c4
children a68e6828d896
comparison
equal deleted inserted replaced
62:b218af069da7 63:04baa003de5a
292 { 292 {
293 multisize * multi = (multisize *)obj; 293 multisize * multi = (multisize *)obj;
294 blueprint * bp = get_blueprint(obj); 294 blueprint * bp = get_blueprint(obj);
295 if(bp->cleanup) 295 if(bp->cleanup)
296 bp->cleanup(obj); 296 bp->cleanup(obj);
297 ffree(multi, sizeof(multi) + multi->size, manager); 297 ffree(multi, sizeof(multisize) + multi->size, manager);
298 } 298 }
299 299
300 blueprint * new_blueprint(uint32_t type, uint32_t size, special_func init, special_func copy, special_func cleanup) 300 blueprint * new_blueprint(uint32_t type, int32_t size, special_func init, special_func copy, special_func cleanup)
301 { 301 {
302 blueprint * bp = malloc(sizeof(blueprint)); 302 blueprint * bp = malloc(sizeof(blueprint));
303 //dirty hack!, move elsewhere 303 //dirty hack!, move elsewhere
304 if (!manager) { 304 if (!manager) {
305 fixed_alloc_init(); 305 fixed_alloc_init();
320 bp->name = NULL; 320 bp->name = NULL;
321 } 321 }
322 return bp; 322 return bp;
323 } 323 }
324 324
325 blueprint * register_type_byid(uint32_t type, uint32_t size, special_func init, special_func copy, special_func cleanup) 325 blueprint * register_type_byid(uint32_t type, int32_t size, special_func init, special_func copy, special_func cleanup)
326 { 326 {
327 check_type_storage(type); 327 check_type_storage(type);
328 if(registered_types[type]) 328 if(registered_types[type])
329 return registered_types[type]; 329 return registered_types[type];
330 registered_types[type] = new_blueprint(type, size, init, copy, cleanup); 330 registered_types[type] = new_blueprint(type, size, init, copy, cleanup);