Stephen’s blog on video games, programming and life. Occasional guest posts from his closest friends.
Wednesday, June 18, 2008
Javascript Malloc and Free
There is no byte sized objects in Javascript. Numbers are 64bit floats and characters are 16bit unicode characters. I have been working on a way to give c developers in a javascript world fine grained control over memory usage. Right now I have two seperate implementations of my memory store. One is based on a massive string and is very efficient in size and reading bytes but it alittle slow at setting bytes. The other is based on a array of numbers. This one is not as efficient but much faster for reading and writing memory. Benchmarks show the array based store can allocate a megabyte worth of memory and set each byte to a value in about six seconds.
Here is a example class that is backed by the memory store:
I know this comment is kind of out of place, but I stumbled on your blog when looking for proof of Wormhole existence, and that I didn't just dream the game up.
Kudos to you for putting words in about it. Where did you get that little pic from?
I know this comment is kind of out of place, but I stumbled on your blog when looking for proof of Wormhole existence, and that I didn't just dream the game up.
ReplyDeleteKudos to you for putting words in about it. Where did you get that little pic from?