Re: [Dev-C++] Re: malloc , extra bytes ! Somewhat urgent !
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Danny R. <dro...@ho...> - 2003-02-24 01:07:41
|
Hi,
Well i dont realy know what youre doing with it.. and i never used =
calloc but it seems your allocating memory for 1000 bytes=20
and a additional 8 bytes.. sizeof(byte) reserves 8 bytes in my opinion. =
is it perhaps that you have to do this:
calloc(1000,BYTE) instead of calloc(1000,sizeof(BYTE))
Well i actualy dont know.. i am just programming in C for just a month =
or so..
----- Original Message -----=20
From: veenurs=20
To: dev...@li... ; ra...@ww...=20
Sent: Monday, February 24, 2003 1:16 AM
Subject: [Dev-C++] Re: malloc , extra bytes ! Somewhat urgent !
Hi !=20
It seems too simple .But what is it !?=20
if( (buffer =3D ( PBYTE )calloc( 1000 ,sizeof(BYTE) )) =3D=3D NULL ){=20
------=20
-------=20
}=20
size =3D _msize( buffer );=20
The size I get it is not 1000 , but 1008 !Same for malloc. Any =
subsequent call to realloc does not add the 8 bytes,though .=20
[ Dev Cpp Version 4.9.7.0 ]=20
What's happening ?=20
BTW - "Generate debugging info" is OFF .=20
Thanks in advance .=20
-Rahul.=20
|