On Saturday, 2 May 2015 at 21:53:42 UTC, Martin Nowak wrote:
On Saturday, 2 May 2015 at 15:15:50 UTC, Jens Bauer wrote:
Will it be possible to have associative arrays without garbage collection ?

You can write an AA container. A RefCounted AA implementation might allow unsafe escaping though.

I think RefCount would do nicely for my own use. (I'm very much used to RefCount from ObjC; never grew up to use the GC there).

What about dynamic strings and dynamic arrays, don't they need GC ?

Same here array slices require a GC to be safe, but one could implement them like std::vector.

While built-in arrays and AAs are nice to have it's trivial to replace them with other containers, no need for GC.

Sounds good. :)

I never even needed dynamic memory allocation on a microcontroller.

Me neither, but I don't know if that would change.
I'm especially thinking about making a small database on a Cortex-M, which would be connected via Ethernet. Thus it would be small, diskless, but respond quickly. Since the STM32F429 Discovery board comes with an on-board 64Mbit SDRAM, it's very tempting to have optional support for large memory.

After trying AA on Javascript, I got quite interested in them (especially for database-use with Bloom filters).

AA would very likely allocate a lot of small blocks. I once wrote a very quick malloc, which had clusters of fixed size blocks for block sizes less than 32 bytes. It sped up our product so much that my boss (who worked on a different platform) came and asked how I did it. :)

Reply via email to