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

State the term- combinational circuit, In a pure combinational circuit is ...

In a pure combinational circuit is it necessary to mention all the inputs in sensitivity disk? if yes, why? Yes in a pure combinational circuit is it essential to mention all

Describe the necessary conditions for deadlock, Describe the necessary cond...

Describe the necessary conditions for Deadlock. Required conditions for deadlock 1. Mutual exclusion 2. Hold and wait 3. No preemption 4. Circular wait Mutual e

What is assembler, What is Assembler An assembler is a program which ta...

What is Assembler An assembler is a program which takes as input a symbolic language program and produces output as its binary machine language equivalent. The input is known a

What are the address-sequencing capabilities, What are the address-sequenci...

What are the address-sequencing capabilities required in a control memory? i. Incrementing the control address register ii. Unconditional branch as specified by address fiel

Simplified boolean expression, Simplified the Boolean Algebra (x + y)(x + z...

Simplified the Boolean Algebra (x + y)(x + z) simplifies to ? Ans. x + yz as simplified the Boolean Algebra expression. [(x + y) (x + z)] = xx + xz + xy + yz = x + xz + xy + y

Explain the life cycle of java server pages, Discuss the life cycle of JSP....

Discuss the life cycle of JSP. A JSP (JavaServer Pages) page services requests like a servlet. Therefore, the life cycle and many of the abilities of JSP pages (particular in t

What is the size limitation of an access database, Size limitation does not...

Size limitation does not relate to number of records in a table within a database. Forms, reports, macros, and modules also add to database size, but is rather minimal compared to

Data structures for parallel algorithms, To apply any algorithm selection o...

To apply any algorithm selection of a proper data structure is very significant. An explicit operation might be performed with a data structure in a smaller time however it might n

Difference between search and search all, SEARCH is a sequential search fro...

SEARCH is a sequential search from the starting of the table. SEARCH ALL is a binary search, continually dividing the table in two halves until a match is found. SEARCH ALL is more

Explain bitwise-inclusive-or operato, Bitwise-Inclusive-OR Operator: i...

Bitwise-Inclusive-OR Operator: inclusive-OR-expression : exclusive-OR-expression inclusive-OR-expression | exclusive-OR-expression The  bitwise-inclusive-OR  operator

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