Mercurial > repos > rhope
comparison runtime/object.c @ 49:3e20ed8959c4
Added initial FFI implementation, Array type and 64-bit integers
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 08 Apr 2010 01:02:18 -0400 |
parents | 1b86a1ee500a |
children | 04baa003de5a |
comparison
equal
deleted
inserted
replaced
48:a24eb366195c | 49:3e20ed8959c4 |
---|---|
291 { | 291 { |
292 multisize * multi = (multisize *)obj; | 292 multisize * multi = (multisize *)obj; |
293 blueprint * bp = get_blueprint(obj); | 293 blueprint * bp = get_blueprint(obj); |
294 if(bp->cleanup) | 294 if(bp->cleanup) |
295 bp->cleanup(obj); | 295 bp->cleanup(obj); |
296 ffree(multi, sizeof(multi) + multi->size, manager); | 296 ffree(multi, sizeof(multisize) + multi->size, manager); |
297 } | 297 } |
298 | 298 |
299 blueprint * new_blueprint(uint32_t type, uint32_t size, special_func init, special_func copy, special_func cleanup) | 299 blueprint * new_blueprint(uint32_t type, int32_t size, special_func init, special_func copy, special_func cleanup) |
300 { | 300 { |
301 blueprint * bp = malloc(sizeof(blueprint)); | 301 blueprint * bp = malloc(sizeof(blueprint)); |
302 //dirty hack!, move elsewhere | 302 //dirty hack!, move elsewhere |
303 if (!manager) { | 303 if (!manager) { |
304 fixed_alloc_init(); | 304 fixed_alloc_init(); |
318 bp->name = NULL; | 318 bp->name = NULL; |
319 } | 319 } |
320 return bp; | 320 return bp; |
321 } | 321 } |
322 | 322 |
323 blueprint * register_type_byid(uint32_t type, uint32_t size, special_func init, special_func copy, special_func cleanup) | 323 blueprint * register_type_byid(uint32_t type, int32_t size, special_func init, special_func copy, special_func cleanup) |
324 { | 324 { |
325 check_type_storage(type); | 325 check_type_storage(type); |
326 if(registered_types[type]) | 326 if(registered_types[type]) |
327 return registered_types[type]; | 327 return registered_types[type]; |
328 registered_types[type] = new_blueprint(type, size, init, copy, cleanup); | 328 registered_types[type] = new_blueprint(type, size, init, copy, cleanup); |