Would either of these solutions work?: - use a scheme like Malloc/free to allocate the buffers when you need them - allocate the buffers on the stack (is there a practical limit to doing this?) and that way they can be recycled when not in use
The terrible downside with stack based allocation is the potential for silent and deadly stack overflow. At least a scheme like Malloc/free would give you an error, but you wouldn't be able to do anything useful with it at runtime! It's an interesting idea and would be very useful for embedded development, How would the static analysis know when a certain buffer is no longer needed, would you need to insert some kind of "static release" statement/attribute somewhere? - Wayne On 15/05/2013, at 8:31, Paul Sokolovsky <pmis...@gmail.com> wrote: > Hello, > > On Wed, 15 May 2013 09:35:14 +1200 > Daniel Beer <dlb...@gmail.com> wrote: > >> On Tue, May 14, 2013 at 09:26:46PM +0300, Paul Sokolovsky wrote: >>> More interesting question is such support for static (if not global) >>> variables. When trying to do Elliptic Curve Cryptography on MSP430 >>> value line devices which top up at 0.5K RAM, you really wish that >>> compiler could "pack" together static buffers of functions which >>> cannot be active at the same time ;-). If anyone know of that to be >>> done by gcc, would be nice to get some pointers. >> >> If you have static buffers which are never in use simultaneously, why >> not keep them together in a union { }? > > Yes, the talk was about offloading the work of proving > non-simultaneous access constraints and creation of that union to the > compiler ;-). Shouldn't be hard for the case of scalar static variables > (function-local dataflow analysis and interprocedural control flow > analysis), so I wondered if someone knows it to be implemented. To be > really useful this should be applied to structural/array vars though, > and that's much harder. > >> >> - Daniel > > > -- > Best regards, > Paul mailto:pmis...@gmail.com > > ------------------------------------------------------------------------------ > AlienVault Unified Security Management (USM) platform delivers complete > security visibility with the essential security capabilities. Easily and > efficiently configure, manage, and operate all of your security controls > from a single console and one unified framework. Download a free trial. > http://p.sf.net/sfu/alienvault_d2d > _______________________________________________ > Mspgcc-users mailing list > Mspgcc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mspgcc-users ------------------------------------------------------------------------------ AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial. http://p.sf.net/sfu/alienvault_d2d _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users