[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] [ot] C/C++ mem allocation

On Tuesday, July 16, 2002, at 09:35  AM, <godpup@xxxxxxxxxxxxx> wrote:

how would one allocate n bytes of memory before main is initialized in C/

Create a C++ object as a global variable and give it a constructor that allocates memory.
If you have other static variables allocating memory then you may be out of luck as far as reserving contiguous space, since there is no way to guarantee the order of initialization of static variables.

--- james mccartney   james@xxxxxxxxxxxxxx   <http://www.audiosynth.com>
SuperCollider - a real time synthesis programming language for the PowerMac.