lh1008 / malloc

0x0B. C - malloc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

0x0B. C - malloc

Learning Objectives

  • What is a program break
  • How to play with a program break in order to allocate memory dynamically
  • How the glibc malloc and free functions work
  • What is ASLR
  • What is memory alignment
  • What is a memory page
  • How to encapsulate the memory management in order to hide it from the user

man or help

  • sbrk
  • brk
  • malloc

Tasks

0. Naive malloc Build the naive malloc that is presented in the concept page.

  • Prototype: void *naive_malloc(size_t size);

1. malloc Write you own malloc function that allocates space in the heap

  • Prototype: void *_malloc(size_t size);

2. free Write you own free function that frees a memory space

  • Prototype: void _free(void *ptr);

About

0x0B. C - malloc


Languages

Language:C 100.0%