Git Product home page Git Product logo

memtrace's Issues

bonus (free함수)

bonus에서 free를 구현하다가 궁금한 점이 생겨서 질문드립니다.

  1. part1~part3와 bonus에서 아래와 같은 상황도 고려해야하나요?

    void *c=NULL;

    free(c);

ptr가 NULL이면 LOG_FREE를 출력하게 free를 짰는데도 아무것도 안떠서 혹시 이런 상황에는 어떻게 출력이 되어야 하는건지 궁금합니다.

  1. 초기화 하지 않은 variable에 대해 free나 realloc을 해주면 illegal free로 처리하는 것이 맞는지 궁금합니다.

    void *c;

    free(c);

감사합니다!

민철기 사진 민철기 2020-04-04 18:37

  1. free 함수에 NULL을 넣는 경우는 따로 처리하지 않으셔도 됩니다.
  2. 일반적인 경우에 초기화 되지 않았으면 illegal free로 처리되는게 맞습니다.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.