buddy system in memory management - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

buddy system in memory management

happyiitdhappyiitd Posts: 5Member
I want a c++ program to implement dynamic memory management module using Buddy system. Assume memory (use an array) to be of size 2n . Write the following functions.

1.Allocation module (that allocates block(number of array locations))
2. De allocation module and return to corresponding available list
3.Functions for showing status of available blocks (use doubly linked structure) and of used blocks (corresponding address indices and size in tabular form).
PLEASE HELP FAST.

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    : I want a c++ program to implement dynamic memory management module using Buddy system. Assume memory (use an array) to be of size 2n . Write the following functions.
    :
    : 1.Allocation module (that allocates block(number of array locations))
    : 2. De allocation module and return to corresponding available list
    : 3.Functions for showing status of available blocks (use doubly linked structure) and of used blocks (corresponding address indices and size in tabular form).
    : PLEASE HELP FAST.
    :

    start here
    [code]
    #include

    int main()
    {
    // put your code here
    }

    [/code]

  • happyiitdhappyiitd Posts: 5Member
    : : I want a c++ program to implement dynamic memory management module using Buddy system. Assume memory (use an array) to be of size 2n . Write the following functions.
    : :
    : : 1.Allocation module (that allocates block(number of array locations))
    : : 2. De allocation module and return to corresponding available list
    : : 3.Functions for showing status of available blocks (use doubly linked structure) and of used blocks (corresponding address indices and size in tabular form).
    : : PLEASE HELP FAST.
    : :
    :
    : start here
    : [code]
    : #include
    :
    : int main()
    : {
    : // put your code here
    : }
    :
    : [/code]
    :
    :
    wat a suggestion my friend!!!!!!!!!!!!
    actually i need this part for a bigger project of a compiler development
    I would appreciate if you could put in a bit of real time code.
    thanx
  • stoberstober Posts: 9,765Member ✭✭✭
    [b][red]This message was edited by stober at 2005-11-16 13:56:36[/red][/b][hr]
    : :
    : wat a suggestion my friend!!!!!!!!!!!!

    [blue]The sarcasm was intended :-) Most people at least make an effort to write the program themself, post the problem sections and ask specific questions. [/blue]
    : actually i need this part for a bigger project of a compiler development
    : I would appreciate if you could put in a bit of real time code.
    :

    [blue]Don't have the time to write your program for you. Shouldn't be very difficult to implement using std::list or std::queue if you are wrinting a c++ program. Doing that sort of thing (wrinting your allocation functions) is not a very common thing to do. But it would be useful in college to help learn the language -- and for compiler writers to implement something like malloc(), calloc(), realloc() and new operator. [/blue]





  • LundinLundin Posts: 3,711Member
    : : : I want a c++ program to implement dynamic memory management module using Buddy system. Assume memory (use an array) to be of size 2n . Write the following functions.
    : : :
    : : : 1.Allocation module (that allocates block(number of array locations))
    : : : 2. De allocation module and return to corresponding available list
    : : : 3.Functions for showing status of available blocks (use doubly linked structure) and of used blocks (corresponding address indices and size in tabular form).
    : : : PLEASE HELP FAST.
    : : :
    : :
    : : start here
    : : [code]
    : : #include
    : :
    : : int main()
    : : {
    : : // put your code here
    : : }
    : :
    : : [/code]
    : :
    : :
    : wat a suggestion my friend!!!!!!!!!!!!
    : actually i need this part for a bigger project of a compiler development
    : I would appreciate if you could put in a bit of real time code.
    : thanx
    :


    It seems that the program is rather simple compared to writing a compiler. If you fail with this without even trying, good luck with the compiler...
Sign In or Register to comment.