[Dev-C++] RES: RES: RES: RES: Question about software design
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <and...@su...> - 2007-11-21 17:04:57
|
I don´t know the size of your "heap-patience", people :-)) But... -When I do a malloc for a simple vector, can´t I discover if its memory is shared with other lockable stuff? -Does the Operating System decide by itself to do this kind of sharing mode, or do I need to do it through my program? Thinking in another way... -This "driver or similar" belongs to my application, doesn´t it? If it´s true, I know if my program is using this kind of lockable memory, don´t I? (I think it´s the last) Thank you!!! Andre -----Mensagem original----- De: Rafael Menezes [mailto:so...@gm...] Enviada em: quarta-feira, 21 de novembro de 2007 13:19 Para: André Macário Barros Assunto: Re: [Dev-C++] RES: RES: RES: Question about software design Hi André Yes and No. That depends of how you have allocated that memory. Some functions can alloc shared memory (Yes Per, that is exactly (RAM disk) what am I doing in that app). This ones you must free by hand or they will keep in there until a system restart or something like (Memory clean tools... i don't know. Maybe some vb script with a mychar(999999) inside ;). I think Per have just released a better text in that subject. Here comes: "When you run an application under Win32, the C or C++ library contains the heap implementation (malloc(), calloc(), new, ...) and requests memory from the OS. The OS keeps track of all memory pages it gives to the application. It has to, since the processor is running in protected mode with a Memory Management Unit (MMU) to map between logical and physical memory addresses. Whenever the application ends, the OS can release all memory pages that was mapped to the application. Only if the memory page is shared with a driver or similar, and the driver has the page locked, will the OS have to keep the memory page until the lock is released." That answer your question (with a big YES if the next sentence doesn't fit to your application.), and explain my app behavior. Regards Rafael No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.2/1142 - Release Date: 20/11/2007 17:44 |