Original Post
Hey guys,
I was testing my code and found that when I allocated a certain size chunk and then freed it there was some left over. I'm using dlmalloc as my allocator. I finally boiled it down to a reproducible example, but am I just not understand what info.uordblks means?
code:
#include "malloc.h"
#include
int main( void )
{
dlfree( dlmalloc( 10 ) );
void * data = dlmalloc( 174904 );
dlfree( data );
mallinfo info = dlmallinfo();
printf( "%d\n", info.uordblks );
getchar();
}
The documentation says /* total allocated space */ for uordblks.
The print statement says there is 40 left over.
I was testing my code and found that when I allocated a certain size chunk and then freed it there was some left over. I'm using dlmalloc as my allocator. I finally boiled it down to a reproducible example, but am I just not understand what info.uordblks means?
code:
#include "malloc.h"
#include
int main( void )
{
dlfree( dlmalloc( 10 ) );
void * data = dlmalloc( 174904 );
dlfree( data );
mallinfo info = dlmallinfo();
printf( "%d\n", info.uordblks );
getchar();
}
The documentation says /* total allocated space */ for uordblks.
The print statement says there is 40 left over.