Date: Fri, 21 Aug 2026 13:31:01 +0200
Looking at the recent Big-int proposal, this is or could be a case for C++
to provide a dynamically sized array (ie. stack allocated if on the stack).
C has a dynamically allocated array type and it is possible to program
something like this by hand in C maybe with MACRO usage inside a function -
but it is contained to that function.
Returning dynamically sized objects is not even possible with current
calling conventions - but maybe there exists some tricks to get around that
(eg. before returning; perhaps rearrange the stack and then move the
stackpointer once returned).
Now there would be some type of tracking the size as well and it should be
possible to specify staticly how many bytes/bits should be used for that....
Right now the closest there is, is some types of arena put on the stack to
start..
What do you think?
to provide a dynamically sized array (ie. stack allocated if on the stack).
C has a dynamically allocated array type and it is possible to program
something like this by hand in C maybe with MACRO usage inside a function -
but it is contained to that function.
Returning dynamically sized objects is not even possible with current
calling conventions - but maybe there exists some tricks to get around that
(eg. before returning; perhaps rearrange the stack and then move the
stackpointer once returned).
Now there would be some type of tracking the size as well and it should be
possible to specify staticly how many bytes/bits should be used for that....
Right now the closest there is, is some types of arena put on the stack to
start..
What do you think?
Received on 2026-08-21 11:31:57
