site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=q27UVhgo/SaRUKaTgj0kGOOZ58wFj/jJX/Q7qCwph54J8Js8dyXrA8scBg2aSE829OFExaQh1PSljLVPlzJGDQONiHMuWxUUxWjcdrnLvHa52PFacigg67FC5Mmox5k2XFamF3+AobuoQnMrh9O7QcRZGC6cnVeIXKma7CSs7u8= Hi All, Thanks for the information. How can I see the source code for the Darwin Kernel? Does it come with the installation? Any links? Regards, Mohan. On 6/29/05, Mike Smith <drivers@mu.org> wrote:
On Jun 28, 2005, at 10:06 PM, Mohanasundaram Chandran wrote:
I am in the process of implementing a memory manager for Darwin.I Linux i used the sys_brk system call (not the user lever legacy POSIX brk function.). I would like to know what is the similar system call in Darwin. Can anybody help please?
Darwin does not use the simplistic heap model that is traditional in many *nix systems, due to the very complex memory map you find in typical MacOS X applications.
User programs (and that includes library code) that wants to allocate process virtual space can use malloc, if the chunk will be managed whole. This is the simplest (and most portable) way to go about it.
If you don't have a 1:1 allocate:free model, then vm_allocate and vm_deallocate are the interfaces that you're looking for.
See the source code for the default Darwin allocator in Libc/gen/scalable_malloc.c
= Mike
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com