[computer-go] Language
Álvaro Begué
alvaro.begue at gmail.com
Wed Nov 14 08:04:41 PST 2007
On Nov 14, 2007 10:54 AM, steve uurtamo <apoxonpoo at yahoo.com> wrote:
> > I just wanted to point out that free() is not a system call. The heap is
> handled by the
> > C library, and the OS is mostly not involved in it.
>
>
>
> my bad. thanks. :)
>
> in that case, i'm impressed that i can do 2GB allocations.
Well, the process has some memory assigned to it, and the C library will ask
for more when it runs out (most likely when you allocate 2GB), but most
calls to malloc() won't result in a system call, and I don't think a call to
free() ever results in a system call. The details of how more memory is
acquired depend on the platform. You can get a very good idea of how all of
this works by reading section 8.7 of "The C programming language", by
Kernighan and Ritchie.
Álvaro.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://computer-go.org/pipermail/computer-go/attachments/20071114/0596f6a1/attachment.htm
More information about the computer-go
mailing list