www.digitalmars.com         C & C++   DMDScript  

c++ - A Problem when allocating a lot of Memory

Hi,

I have a problem when allocating a lot of Memory (this matches both C and 
C++):

When I allocate a smaller (and free it) and later a greater piece of memory,
where each would fit into the actual remaining memory, but not both,
then the second allocation fails.

This issue occurs only when I use the Digital Mars compiler (v8.42).

I have attached a zipfile including the necessary files and would be glad if
someone could tell me how to get rid of this.

Thanks in advance.

Bernd Feldmann-Raiff



begin 666 testallocate.zip
M4$L#!!0````(`#N+(SG&I";^  ```*H````.````=&5S=&%L;&]C871E+F-5
MS3$.`B$0A>&>A#M,5BH2A&BCG;$P%E;&"XPPN"0L)"-[?W'7QO9]?_*LUG!Z
M<J((#WHWF##GZFUD(BF 6TR9H'5:`!MM_0HXM[$RG(E+  OE,&$IYHXIQC4(
M/8:=<P?CCL;MOZ.5PFI05\) K)9,W>I+_4R*32H^SX% ^+L<!RD^4$L#!!0`
M```(`)B+(SE)JY04A ```*P````0````=&5S=&%L;&]C871E+F-P<%7-L0["
M(!2%X9V$=[BI3"0(T44WXV <G(PO<(6+):'0('U_L>W2]7Q_<K24<'F70!Y>
M]*TP8(S9:E^(.(-F/D2"VF &K+2WX[ 03K7/!:Y4DH,;13= 2NJ)P?LE<"V'
M S$G9<[*'/^CYDQ+$'="1T7,F7CDCUB-LUU(-DZ.H-N<]AUG/U!+`P04````
M" "Q424Y*1N7AML"``#H!P``# ```'1E<W1A;&QO8V%T92YHQ57;;MI $'U'
MXA\FE$8&07  T+1IJH9+E$B(5 U1'YH*V=XQ7M5>H_4Z(:GZ[YU=FW)M2UY:
M),/N7,^9BVE4J_#>E1Q]&&.B('+",/8:OD0L%H!T/ \1%*F,PE%X%&0*)U5!
M+*&+4C"XQ)!%CA#U3P[W_<R D3$T;?NT;K^NVRTM;!0+C2J4K]!A*,O&K#R,
MI^5<5RR\X+Y A&4R'MR,+X;##[V+\6!R-;D>]8:W_4&?+$C-!?[)  LO3!G"
MVT2QD+M'P;L-(8\W9$Z2H%0DS#' 09:%69.)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V%T92YC4$L!`A0`
M% ```` `F(LC.4FKE!2$````K ```! ```````````` " ``K ```'1E<W1A
M;&QO8V%T92YC<'!02P$"% `4````" "Q424Y*1N7AML"``#H!P``# ``````
M`````" (``! `0``=&5S=&%L;&]C871E+FA02P$"% `4````" "R424YNY B
M[HX#``##% ``&P```````````" (``!G! ``=&5S=&%L;&]C871E7V)U:6QD
?7VQO9RYH=&UL4$L%! `````$``0`_P```"X(````````
`
end
Sep 05 2008