Continue to Site

Welcome to EDAboard.com

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.

calloc() allocates only contiguous memory?

Status
Not open for further replies.

sivamit

Full Member level 4
Joined
Dec 1, 2005
Messages
201
Helped
20
Reputation
40
Reaction score
14
Trophy points
1,298
Activity points
2,651
calloc()

Does calloc() allocate only contiguous memory Or it can allocate non-contiguous also..?


Thanks
 

Re: calloc()

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.
 

calloc()

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!!!!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top