Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalinheritance steps... (property sheet and pages) Pin
Joan M29-Oct-02 20:26
professionalJoan M29-Oct-02 20:26 
GeneralRe: inheritance steps... (property sheet and pages) Pin
jhwurmbach29-Oct-02 21:16
jhwurmbach29-Oct-02 21:16 
GeneralRe: inheritance steps... (property sheet and pages) Pin
Joaquín M López Muñoz29-Oct-02 21:22
Joaquín M López Muñoz29-Oct-02 21:22 
GeneralExtension Dlls Pin
Furrukh Azam29-Oct-02 19:59
sussFurrukh Azam29-Oct-02 19:59 
GeneralRe: Extension Dlls Pin
Pavel Klocek29-Oct-02 21:07
Pavel Klocek29-Oct-02 21:07 
GeneralRe: Extension Dlls Pin
Trollslayer30-Oct-02 1:43
mentorTrollslayer30-Oct-02 1:43 
Questionrealloc assumption...? Pin
alex.barylski29-Oct-02 19:42
alex.barylski29-Oct-02 19:42 
AnswerRe: realloc assumption...? Pin
Stephane Rodriguez.29-Oct-02 20:14
Stephane Rodriguez.29-Oct-02 20:14 
You have truncated the text where it says the buffer is potentially reallocated, which means a balance free.

Now you have the CRT code, in realloc.c, it executes this :
/* try malloc-ing a new block of the requested size. if successful,
* copy over the data from the original block and free it.
*/
if ( (retp = _malloc_base(newsize)) != NULL ) {
    memcpy(retp, pblock, oldsize);
    _free_base_lk(pblock);
}


Which is the answer to your question.

There is also another way of seeing whether the previously allocated block has been freed or not : the dummy characters. In DEBUG mode, your block will be filled with either of these :

<br />
char _bNoMansLandFill = 0xFD;   /* fill no-man's land with this */<br />
char _bDeadLandFill   = 0xDD;   /* fill free objects with this */<br />
char _bCleanLandFill  = 0xCD;   /* fill new objects with this */<br />


In your case, that's DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD.





How low can you go ?
(MS rant)

GeneralRe: realloc assumption...? Pin
alex.barylski30-Oct-02 9:30
alex.barylski30-Oct-02 9:30 
GeneralRe: realloc assumption...? Pin
Stephane Rodriguez.30-Oct-02 9:42
Stephane Rodriguez.30-Oct-02 9:42 
GeneralSpy ++++ Pin
Shamoon29-Oct-02 19:23
Shamoon29-Oct-02 19:23 
GeneralRe: Spy ++++ Pin
dabs29-Oct-02 20:09
dabs29-Oct-02 20:09 
GeneralRe: Spy ++++ Pin
567890123430-Oct-02 2:32
567890123430-Oct-02 2:32 
GeneralClass in Dll Pin
stevenson29-Oct-02 19:16
stevenson29-Oct-02 19:16 
GeneralRe: Class in Dll Pin
Bugra Barin29-Oct-02 20:06
Bugra Barin29-Oct-02 20:06 
GeneralRe: Class in Dll Pin
Bugra Barin29-Oct-02 20:08
Bugra Barin29-Oct-02 20:08 
GeneralFirst error for the night.... Pin
Nick Parker29-Oct-02 17:06
protectorNick Parker29-Oct-02 17:06 
GeneralRe: First error for the night.... Pin
Anatari29-Oct-02 17:28
Anatari29-Oct-02 17:28 
GeneralRe: First error for the night.... Pin
Nick Parker29-Oct-02 17:39
protectorNick Parker29-Oct-02 17:39 
GeneralRe: First error for the night.... Pin
Anatari29-Oct-02 17:48
Anatari29-Oct-02 17:48 
GeneralRe: First error for the night.... Pin
Nick Parker29-Oct-02 17:50
protectorNick Parker29-Oct-02 17:50 
GeneralRe: First error for the night.... Pin
Christian Graus29-Oct-02 18:21
protectorChristian Graus29-Oct-02 18:21 
GeneralRe: First error for the night.... Pin
Nick Parker29-Oct-02 18:28
protectorNick Parker29-Oct-02 18:28 
GeneralGetWindowLong problem Pin
Dan_P29-Oct-02 16:55
Dan_P29-Oct-02 16:55 
GeneralRe: GetWindowLong problem Pin
Paul M Watt29-Oct-02 17:12
mentorPaul M Watt29-Oct-02 17:12 

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.