Click here to Skip to main content
15,911,762 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: append CString [] Pin
David Nash23-Feb-05 7:03
David Nash23-Feb-05 7:03 
GeneralDate Validation Pin
Renjith Ramachandran22-Feb-05 23:16
Renjith Ramachandran22-Feb-05 23:16 
GeneralRe: Date Validation Pin
David Crow23-Feb-05 2:40
David Crow23-Feb-05 2:40 
GeneralRe: Date Validation Pin
James R. Twine23-Feb-05 2:51
James R. Twine23-Feb-05 2:51 
GeneralRe: Date Validation Pin
anand_study17-May-05 19:47
anand_study17-May-05 19:47 
Generalmalloc fails Pin
Jay Carter22-Feb-05 23:00
Jay Carter22-Feb-05 23:00 
GeneralRe: malloc fails Pin
$8823-Feb-05 1:33
$8823-Feb-05 1:33 
GeneralRe: malloc fails Pin
Mike Dimmick23-Feb-05 2:30
Mike Dimmick23-Feb-05 2:30 
It sounds like your allocation pattern is causing heap fragmentation. I'm not sure whether Windows 2000 or XP automatically coalesce adjacent free blocks, or whether they leave those blocks as separate blocks. I suspect that if the code from the VC6 runtime library was used or adapted, they only join the block being freed with the next block if that is also free.

You can force a full coalesce of the heap by calling _heapmin. The documentation currently states that it's only supported by Windows NT but my reading of the source indicates it should also work on 2000, XP and 2003. Under the covers this function calls HeapCompact.

One strategy to prevent the fragmentation in the first place is to allocate different size blocks, or blocks with different lifetimes, from different heaps. You can create your own heap using HeapCreate.

The heap code is really meant for small variable-size blocks. If you're creating 512KB buffers, you might be better off calling VirtualAlloc directly.

Stability. What an interesting concept. -- Chris Maunder
GeneralRe: malloc fails Pin
Jay Carter23-Feb-05 3:30
Jay Carter23-Feb-05 3:30 
GeneralRe: malloc fails Pin
Neville Franks23-Feb-05 9:02
Neville Franks23-Feb-05 9:02 
QuestionTo set modified time of a file as current time? Pin
Monisankar22-Feb-05 22:50
Monisankar22-Feb-05 22:50 
AnswerRe: To set modified time of a file as current time? Pin
Monisankar22-Feb-05 23:36
Monisankar22-Feb-05 23:36 
GeneralCEdit Line Length Limit Problem Pin
fangzj22-Feb-05 22:17
fangzj22-Feb-05 22:17 
GeneralRe: CEdit Line Length Limit Problem Pin
David Crow23-Feb-05 2:38
David Crow23-Feb-05 2:38 
GeneralRe: CEdit Line Length Limit Problem Pin
fangzj23-Feb-05 3:43
fangzj23-Feb-05 3:43 
GeneralRe: CEdit Line Length Limit Problem Pin
David Crow23-Feb-05 5:57
David Crow23-Feb-05 5:57 
GeneralRe: CEdit Line Length Limit Problem Pin
fangzj23-Feb-05 13:07
fangzj23-Feb-05 13:07 
GeneralRe: CEdit Line Length Limit Problem Pin
David Crow24-Feb-05 3:02
David Crow24-Feb-05 3:02 
GeneralRe: CEdit Line Length Limit Problem Pin
fangzj24-Feb-05 13:22
fangzj24-Feb-05 13:22 
GeneralRe: CEdit Line Length Limit Problem Pin
David Crow24-Feb-05 16:15
David Crow24-Feb-05 16:15 
GeneralGET RESOURCE ID'S Pin
kedar.dave22-Feb-05 22:15
kedar.dave22-Feb-05 22:15 
GeneralRe: GET RESOURCE ID'S Pin
Bernhard22-Feb-05 22:38
Bernhard22-Feb-05 22:38 
Generalmulti page internet explorer Pin
storein22-Feb-05 21:15
storein22-Feb-05 21:15 
GeneralTabCtrl In a SDI project Pin
Tcpip200522-Feb-05 19:43
Tcpip200522-Feb-05 19:43 
GeneralRe: TabCtrl In a SDI project Pin
Tcpip200522-Feb-05 21:36
Tcpip200522-Feb-05 21:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.