[ANN] malloc'd ByteArrays
Brian Rice
water at tunes.org
Mon Dec 12 15:52:39 PST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
So I've now uploaded a minimally-working malloc()/free() VM module
that minimally supports use as a ByteArray. There are new VM sources
and images, and I've updated the alpha tree and the slate-current
tarball with this new feature.
The basics can be read in src/mobius/vm/platform/malloc.c with vm/ext/
malloc.slate holding the primitives.
The user-land code is extremely primitive and is src/lib/
memoryarea.slate. MemoryArea is a "dual personality" type, acting as
an ExternalResource, but also appearing as a ByteArray when it is
open - print-outs will also change if it is open or closed, for now.
I added beyond the basic primitives, a
replaceFrom:to:with:startingAt: batch byte-mover, but there's some
kind of bug in the readMemory/writeMemory routines where only the
first byte is being copied. I'm sure the problem is simple, since the
source is simple, but for now I've left the method commented out. If
someone can look at this and spot my error, I'll gladly patch it up
or accept a patch.
In any case, this is a first working revision and doesn't break
anything. Enjoy. :)
PS: Any ideas on how to use it more generally than the origianl Cairo
use-case? I'll take a look at ExternalLibrary and see what can be
done there.
- --
- -Brian
http://tunes.org/~water/brice.vcf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFDng1HPVkAvLW1zf4RApB/AJ9T93wZjOGe8dA/ZUGmD6isYJwwWACfYxej
4Uh6Fps8DRTxGcwdY2gKrFw=
=gkfb
-----END PGP SIGNATURE-----
More information about the Slate
mailing list