Re: phk malloc, was (Re: ptmalloc2)

看板DFBSD_kernel作者時間21年前 (2005/02/23 12:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串10/57 (看更多)
:Jonathan Dama wrote: :> If you put 'Z' into your malloc option strings, malloc will :> touch all of the allocated pages for you. : :Will this cause malloc to guarantee that it, or the OS will actually :make the requested amount of physical memory available to such a process, :and never give them back to the OS as long as the process is reusing :that memory, and not calling any allocation functions after this memory :is preallocated? Dan, this guarenteed memory stuff comes up every few months pretty much every since I ever started working with UNIX. I have yet to see a single program that would benefit from it. Not one. The answer is: libc has no support for it because 99.9% of the programs that exist in this world have no use for it and would not benefit from it. If you want total control over the backing store for a program's memory there is nothing stopping you from writing your own malloc wrapper to wire the memory or to use a file-backed mmap or something like that. The plain fact of the matter is that for any system where it matters, the person running the program will set a datasize limit or the program itself will be self-regulating. -Matt Matthew Dillon <dillon@backplane.com>
文章代碼(AID): #12700500 (DFBSD_kernel)
討論串 (同標題文章)
文章代碼(AID): #12700500 (DFBSD_kernel)