Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
The memory block allocated by a single calloc() call obviously must be contiguous according to the parameters of the function. But successive calls of calloc() may return non contiguous memory blocks, depending on the implementation.
I think calloc can allocate and initialize memory, if the asked memory is available contiguously where as malloc can allocate even if the memory is not available contiguously but available at different locations.
Hi all,
when will malloc allocate non contiguous memory?if it is not contiguous,then there is no need to call the memory as a "block".
So I think, malloc and calloc allocate memory in blocks.two blocks may or may not be contiguous but memory within a block will obviously be contiguous!!!!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.