[Mono-devel-list] malloc and free on CLI

Jeyasankar Kottalam mono at jey.kottalam.net
Sat Jul 16 16:21:22 EDT 2005

Quoting Kornél Pál <kornelpal at hotmail.com>:

> As far as I know malloc and free are C runtime library functions not
> intrinsic functions. I think they should not be implemented at compiler
> level. These functions are allocating memory from a heap.

Correct, but I am also writing a partial libc for a couple of reasons: 
I'd like
to be able to test "real world" applications, and it is also part of the
acceptance criteria that I demonstrate a "real world" C application 
under Mono.
Regardless of whether I write the final implementation, this is an issue that
needs to be considered.

>> - The mysterious "localloc" instruction.
> The memory allocated by localloc will be freed when the method return. This
> can and should be used to implement the C "alloca" function and should be
> compiled directly to localloc without any runtime library. Note that

Thanks for pointing that out, I'll add that as an intrinsic.

-Jey Kottalam

More information about the Mono-devel-list mailing list