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

Illustrate function of 4-input multiplexer using basic gates, Illustrate fu...

Illustrate functional diagram of digital multiplexer . Write the scheme of a 4- input multiplexer using basic gates (AND/OR/NOT) and explain its operation. Ans: Multiple

Real-time software, Real-Time Software Programs that monitor/analyze...

Real-Time Software Programs that monitor/analyze/ control real world events as they take place are known as real-time software. Elements of real-time software involve a data

What is race-around problem and how can you rectify this, What is Race-arou...

What is Race-around problem? How can you rectify this? The clock pulse which remains into the 1 state whereas both J and K are equal to 1 will reason the output to complement a

Explain the meaning of accept socket primitive, Explain the meaning of A...

Explain the meaning of ACCEPT socket primitive. The Accept Primitive: A server which uses connection-oriented transport should call procedure accepts to accept

What do you mean by video memory, Q. What do you mean by Video Memory ? ...

Q. What do you mean by Video Memory ? As declared before video memory is also entitled framebuffer since it buffers video frames to be displayed. The quality of a video display

Describe the structure of a neuron - artificial intelligence, 1. Figure 1 b...

1. Figure 1 below shows the truth table for five different functions. Each truth table shows the inputs x1, x2 and the desired output d. (a) Write down which of these functions

Explain in brief about the broadband, Explain in brief about the broadband ...

Explain in brief about the broadband It isn't just computers which can be linked without wires, different peripheral devices can be linked to a computer system without the need

What is binary search, Binary Search: Search a sorted array by repeatedly i...

Binary Search: Search a sorted array by repeatedly in-between the search interval in half. Start with an interval covering the entire array. If the value of the search key is less

Definition of a micro controllers, Before we take a detailed look about the...

Before we take a detailed look about the Motorola 68HC11 series of micro controllers it is useful to define what is meant by a micro controller. As the name suggests a micro contro

Java Programming, How to parse n size depth node in java and create output ...

How to parse n size depth node in java and create output in same tree format?

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