Csound Csound-dev Csound-tekno Search About

[Cs-dev] mcalloc vs. mmalloc

Date2006-08-11 11:09
From"Steven Yi"
Subject[Cs-dev] mcalloc vs. mmalloc
AttachmentsNone  

Date2006-08-11 11:24
FromVictor Lazzarini
SubjectRe: [Cs-dev] mcalloc vs. mmalloc
As far as I know, malloc and calloc are just different interfaces
to the same thing, with calloc being, as you said, preferred for
arrays as it initialises all elements to 0.

mmalloc and mcalloc are as far as I can tell glibc only (they do not
feature on MS Windows),  part of so-called 'memory-mapped' malloc
package.

Victor

At 11:09 11/08/2006, you wrote:
>Hi All,
>
>I was wondering today what the difference was between mmalloc and
>mcalloc is.  It seems that one initializes to zeros while one doesn't.
>  Since I'm no C expert, it seems to me that one would want to
>initialize everything in the struct after using either if allocating
>memory that's sizeof(struct) so what their starting state is wouldn't
>matter, so this is a little beyond me when to use which.
>
>Thanks!
>steven
>
>-------------------------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-08-11 11:55
From"Steven Yi"
SubjectRe: [Cs-dev] mcalloc vs. mmalloc
AttachmentsNone  

Date2006-08-11 12:20
Fromjpff@codemist.co.uk
SubjectRe: [Cs-dev] mcalloc vs. mmalloc
calloc allocates an array of zeroed items while malloc just gives a
single unmodified chunk.  The mcalloc and mmalloc are views of this.
Some programmers always use calloc, and others malloc.  Personally I
use malloc except when I am certain that I want it zeroed.
==John ffitch

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-08-11 12:22
From"Steven Yi"
SubjectRe: [Cs-dev] mcalloc vs. mmalloc
AttachmentsNone