Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7433999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:45:44+00:00 2026-05-29T09:45:44+00:00

As an assignment in operating systems we have to write our own code for

  • 0

As an assignment in operating systems we have to write our own code for malloc and free in C programming language, I know if i asked the code for it there is no point of me to study. i’m facing the problem of not knowing where to include initializing char array with 50000 bytes and making two lists free and used. in my function i can’t trigger malloc or free to happen automatically. and a 3rd party main program will be used to test my functions…..
if my file is mymalloc.c or what ever

    void* myalloc(size_t size)
    {
        //code for allocating memory
    }
    void myfree(void *ptr)
    {
        //code for free the memory
    }

where do the code for initiating memory space and lists will go..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:45:46+00:00Added an answer on May 29, 2026 at 9:45 am

    I think you only have to implement a memory manager. So you don’t have to use brk, sbrk, …
    Just put used memory in a simple array and fragment it somehow. Since it’s homework you want to make it as simple as possible or else you run into problems due to complexity/time constraints of your assignment.

    You only have to decide which tactic you want to use. I’d suggest to use the buddy system. Though it’s a bit more complicated than the most simple ones.. maybe fixed sized fragmentation is simpler..

    Maybe this is also a good read.

    Don’t do something low-level as suggested in the other answers..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For a school assignment I have to write x86 assembly code, except I can't
For my Operating Systems class I have an assignment due that is built onto
I am working on an Operating Systems assignment for one of my summer classes.
I'm writing a program monitor as an assignment for an operating systems course (very
I have a bunch of assignment operations in Visual Studio, and I want to
For my university assignment I have to design some basic managment system for sicknesses
For a database assignment I have to model a system for a school. Part
For my assignment I have been assigned the task of creating a DTD for
For my university assignment I have to make a networkable version of pacman. I
I'm currently working on an assignment and this have had me stuck for hours.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.