[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/
C++?


Create a C++ object as a global variable and give it a constructor that allocates memory.
 However:
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.
<ftp://www.audiosynth.com/pub/updates/SC2.2.15.sea.hqx>