Re: Allocationg memory: contigously ?
On Oct 18, 11:55 pm, horacius....@gmail.com wrote:
> Hi,
>
> if I allocate memory in a simple program like
>
> int* pint1=new[1000];
> int* pint2=new[1000];
> int* pint3=new[1000];
>
> then memory is allocated on the heap. My question is if this three
> "memory fragmetns" are allocated contigously. And if not, what could I
> do to allocate them contigously.
>
> Thanks
1). They might be allocated contigously but this is not always
guaranteed.
2). Honestly I'm not quite clear about this point, I think you might
need to define your own memory allocation strategy, using some
"placement new operator" or something...
Regards,
-robin
|