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

Difference among interrupt service routine and subroutine, Subroutine are t...

Subroutine are the part of implementing processes (like any process can call a subroutine for achieve task), whereas the interrupt subroutine never be the part. Interrupt subroutin

Performance and issues in pipelining-speedup, Performance and Issues in Pip...

Performance and Issues in Pipelining Speedup:   Firstly, we get the speedup factor that is we see how much speed up performance we get through pipelining. First we get the

How to export a dreamweaver document as xml file, Q. How to export a dreamw...

Q. How to export a dreamweaver document as xml file? Step 1: Choose File -> Open, Step 2: Select document which uses a template (and has editable regions) Step 3: Click O

Artificial intelligence, 2. The Turing test has often been incorrectly inte...

2. The Turing test has often been incorrectly interpreted as being a test of whether or not a person could distinguish between responses from a computer and responses from a person

What are delay systems in telecommunication networks, What are delay system...

What are delay systems in telecommunication networks? Delay System: A class of telecommunication networks like data a network that places the call or message arrivals in a qu

Example on plane, Q. If a plane is in the air also there is a fly flying in...

Q. If a plane is in the air also there is a fly flying inside the plane does the plane get heavier when the fly lands? Answer:- It is true that a fly puts weight on a plan

Convergence mean with respect to e-commerce, What does the term convergence...

What does the term convergence mean with respect to E-commerce? Convergence with respect to e-commerce   The ability to leverage and integrate the several data sources and

Gather some ram data after system was powered off, (a) When a forensic exa...

(a) When a forensic examiner arrives at a crime scene, the first task done is referred to as "Incident Response". Summarize the different incident response tasks done in 10 steps.

Two methods of copying a information document, There are basically two meth...

There are basically two methods of copying: Photocopying This is a modified development of photography. It is quite expensive and slow and is not often used for routine rep

Define process, Define Process. Process: It is a program in executi...

Define Process. Process: It is a program in execution; process execution should progress into sequential fashion. Process contains: program counter stack dat

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