Mercurial > repos > rhope
diff runtime/array.c @ 78:4d5ea487f810
Working String implementation and some basic (but nowhere near exhaustive) tests
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 08 Jul 2010 21:55:47 -0400 |
parents | 70af7fa155d0 |
children | 5a08705f7610 |
line wrap: on
line diff
--- a/runtime/array.c Thu Jul 08 09:57:16 2010 -0400 +++ b/runtime/array.c Thu Jul 08 21:55:47 2010 -0400 @@ -1,16 +1,18 @@ #include "integer.h" -#include "object.h" - +#include "object.h" + void _internal_array_copyout(object * array, int32_t index, object * dest) { t_Array * arr = (t_Array *)array; memcpy(((char *)dest) + sizeof(object), ((char *)array) + sizeof(t_Array) + arr->payload.Eltype->bp->size * index, get_blueprint(dest)->size); + get_blueprint(dest)->copy(dest); } void _internal_array_copyin(object * array, int32_t index, object * val) { t_Array * arr = (t_Array *)array; memcpy(((char *)array) + sizeof(t_Array) + arr->payload.Eltype->bp->size * index, ((char *)val) + sizeof(object), arr->payload.Eltype->bp->size); + get_blueprint(val)->copy(val); } object * _internal_array_getboxed(object * array, int32_t index) @@ -51,5 +53,5 @@ ret->payload.Eltype = bp; return ret; -} - +} +