Jonathan S. Shapiro <[email protected]> wrote:
>
>The first, and perhaps most obvious question to ask seems to be: is this
>important? Why is it desirable, in the context of a library targeted at
>embedded use, to stack-allocate this type of structure? Are there interesting
>embedded platforms where the durability of the heap is not guaranteed? I don't
>know the answer to this question, and I'm hopeful that one of you may.
>
>
Well, I've worked on embedded systems where heap allocation just plain wasn't
allowed. I doubt if that's the case that the SQLite folks were thinking of.
>
>The second question: assuming that it IS important, can anyone identify a
>corresponding type-safe pattern? I'm stumped on this one.
>
>
If you get to specify the ABI, you could arrange it so a function call can
return an arbitrarily sized object on the stack. In effect, alloca would become
implementable within the language, rather than being magic. Typesafe, but I'm
sure the implementation would be hairy.
Alex
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev