Click here to Skip to main content
15,917,862 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Libraries Pin
jhwurmbach11-Sep-03 2:10
jhwurmbach11-Sep-03 2:10 
GeneralDialog Help Pin
10-Sep-03 23:23
suss10-Sep-03 23:23 
GeneralRe: Dialog Help Pin
Iain Clarke, Warrior Programmer10-Sep-03 23:44
Iain Clarke, Warrior Programmer10-Sep-03 23:44 
GeneralSDI linkage with dialog Pin
coda_x10-Sep-03 23:21
coda_x10-Sep-03 23:21 
GeneralHorrid Memory Management Issue Pin
Dangleberry10-Sep-03 22:30
sussDangleberry10-Sep-03 22:30 
GeneralRe: Horrid Memory Management Issue Pin
Phil Speller10-Sep-03 23:20
Phil Speller10-Sep-03 23:20 
GeneralRe: Horrid Memory Management Issue Pin
Dangleberry10-Sep-03 23:59
sussDangleberry10-Sep-03 23:59 
GeneralRe: Horrid Memory Management Issue Pin
Phil Speller11-Sep-03 1:37
Phil Speller11-Sep-03 1:37 
Alan,

You shouldn't need to perform any copying. The idea of creating a memory block/pool that is several times larger than the object(s) you want to place within it is to reduce the number of times malloc or new are called (not placement new). When you have filled that block, allocate another and start using that one (you will now have two blocks containing object - there should be no need to copy the contents of your original block to the second one). Keep doing this for as long as you need space to store your objects. A scheme such as a two-way linked list that forms a header at the top of each block will enable you to keep track of each one allocated - and provide a mechansim to remove blocks once all the objects it contains are deleted. This should still be fairly efficient. Actually, I'm pretty sure this is how vector is implemented and I think the growth factor effectively determines the block/pool size used.

Cheers,


Phil
GeneralRe: Horrid Memory Management Issue Pin
Dangleberry11-Sep-03 2:31
sussDangleberry11-Sep-03 2:31 
GeneralRe: Horrid Memory Management Issue Pin
Phil Speller10-Sep-03 23:50
Phil Speller10-Sep-03 23:50 
GeneralRe: Horrid Memory Management Issue Pin
Dangleberry11-Sep-03 0:14
sussDangleberry11-Sep-03 0:14 
GeneralRe: Horrid Memory Management Issue Pin
antlers11-Sep-03 9:39
antlers11-Sep-03 9:39 
GeneralRe: Horrid Memory Management Issue Pin
Dangleberry11-Sep-03 23:15
sussDangleberry11-Sep-03 23:15 
GeneralProblem handling pictures Pin
abhi197110-Sep-03 22:19
abhi197110-Sep-03 22:19 
GeneralRe: Problem handling pictures Pin
Dangleberry10-Sep-03 22:37
sussDangleberry10-Sep-03 22:37 
GeneralRe: Problem handling pictures Pin
abhi197110-Sep-03 22:51
abhi197110-Sep-03 22:51 
GeneralRe: Problem handling pictures Pin
Dangleberry10-Sep-03 22:58
sussDangleberry10-Sep-03 22:58 
GeneralRe: Problem handling pictures Pin
abhi197110-Sep-03 23:02
abhi197110-Sep-03 23:02 
GeneralRe: Problem handling pictures Pin
Dangleberry10-Sep-03 23:41
sussDangleberry10-Sep-03 23:41 
GeneralRe: Problem handling pictures Pin
Jagadeesh VN11-Sep-03 4:51
Jagadeesh VN11-Sep-03 4:51 
GeneralRe: Problem handling pictures Pin
abhi197111-Sep-03 22:36
abhi197111-Sep-03 22:36 
GeneralSocket programming in Visual C++ 6 Pin
fahimtufaillara10-Sep-03 21:55
fahimtufaillara10-Sep-03 21:55 
GeneralRe: Socket programming in Visual C++ 6 Pin
R. Thomas10-Sep-03 22:11
R. Thomas10-Sep-03 22:11 
GeneralRe: Socket programming in Visual C++ 6 Pin
Jagadeesh VN11-Sep-03 4:58
Jagadeesh VN11-Sep-03 4:58 
GeneralMenu on Dialog not working Pin
Ph@ntom10-Sep-03 21:36
Ph@ntom10-Sep-03 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.