Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 710111 Details for
Bug 921676
free() doesn't honor M_TRIM_THRESHOLD
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
testcase
testcase.cpp (text/x-c++src), 712 bytes, created by
Daniel Vrátil
on 2013-03-14 16:08:00 UTC
(
hide
)
Description:
testcase
Filename:
MIME Type:
Creator:
Daniel Vrátil
Created:
2013-03-14 16:08:00 UTC
Size:
712 bytes
patch
obsolete
>#include <unistd.h> >#include <malloc.h> >#include <stdio.h> > >#define NUM 2800000 > > >int main(int a, char *b[]) >{ > void **memory = (void**)malloc(sizeof(void*)*NUM); > > // 128 KB is the default value, lets set it anyway > // After 128 KB, free() should trim > mallopt(M_TRIM_THRESHOLD, 128*1024); > > int i; > for(i=0; i<NUM; i++) { > memory[i] = malloc(64); > } > > for(i=0; i<NUM; i++) { > free(memory[i]); > } > > void *first_address = memory[0]; > void *last_address = memory[NUM-1]; > > free(memory); > > printf( "Finished: %x %x\n", last_address, first_address ); // Just to make sure it's all from the heap and not mmap() > fflush(stdout); > > pause(); > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 921676
: 710111