Define memory allocation functions, Computer Engineering

Assignment Help:

The various memory allocation functions are described below:

(i) malloc( ): It is a memory allocation function that assigns requested size of bytes and returns a pointer to the first byte of the allocated space. The malloc function returns a pointer of type void so we can allocate it to any type of pointer.

(ii) calloc( ): It is another memory allocation function that assigns space for an array of elements, initializes them to zero and then returns a pointer to the memory. This function is normally used for request memory space at run time. Whereas malloc allocates a single block of storage space, calloc allocates multiple block of storage, each of the similar size, and then sets all bytes to zero

(iii) realloc( ): realloc is a memory allocation function that changes the size of previously allocated space. Sometime it may happen that the allocated memory space is larger than what is needed or it is less than what is needed. In both cases, we can change the memory size already allocated with the help of the realloc function called as reallocation of memory

 


Related Discussions:- Define memory allocation functions

Explain function of dual slope analogue to digital converter, Draw and expl...

Draw and explain the function of dual slope analogue to digital converter. Derive the equations used. Ans.               Dual slope A/D converter : This has 4 main blocks.

Database management system, what is time out based schemes in concurrency c...

what is time out based schemes in concurrency control

Interconnection networks, As in PRAM there was not any direct communication...

As in PRAM there was not any direct communication medium between processors so a different model called as interconnection networks have been considered. In the interconnection net

Explain common sub expression elimination, Explain briefly Common sub ex...

Explain briefly Common sub expression elimination of the commonly used code optimization techniques. Common sub expression elimination: In given expression as "(a+b)-(

Function of osi transport layer, Q. Function of OSI Transport Layer? - ...

Q. Function of OSI Transport Layer? - It takes the information to be sent as well as breaks it into individual packets that are sent and reassembled into a complete message by

What is c++ reference and java final, What is C++ reference and JAVA final?...

What is C++ reference and JAVA final? Association ends must be bound at initialization and cannot be altered. C++ references can fully enforce these semantics, and the JAVA fin

Draw logic circuit using 2-input NAND gates, A combinational circuit has 3 ...

A combinational circuit has 3 inputs A, B, C and output F.  F is true for following input combinations A is False, B is True A is False, C is True A, B, C

Tools for performance measurement, Tools for Performance Measurement Th...

Tools for Performance Measurement The reason behind these algorithms has been to gain a speed up and improve the performance. After the parallel algorithm has been written and

Advantage to depth first search, Advantage to depth first search: It j...

Advantage to depth first search: It just looks like it will be a long period it finds 'DAN' until. This highlights an important drawback for depth first search. It can regular

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd