C - Design your own free( ) function

前端 未结 8 1533
感动是毒
感动是毒 2020-12-29 08:27

Today, I appeared for an interview and the interviewer asked me this,

  1. Tell me the steps how will you design your own f
8条回答
  •  一向
    一向 (楼主)
    2020-12-29 09:05

    The knowledge of working of malloc() is necessary to implement free(). You can find a implementation of malloc() and free() using the sbrk() system call in K&R The C Programming Language Chapter 8, Section 8.7 "Example--A Storage Allocator" pp.185-189.

提交回复
热议问题