You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the project for the third course in the [Udacity C++ Nanodegree Program](https://www.udacity.com/course/c-plus-plus-nanodegree--nd213): Memory Management.
6
+
7
+
## Dependencies for Running Locally
8
+
* cmake >= 2.8
9
+
* All OSes: [click here for installation instructions](https://cmake.org/install/)
10
+
* make >= 4.1 (Linux, Mac), 3.81 (Windows)
11
+
* Linux: make is installed by default on most Linux distros
12
+
* Mac: [install Xcode command line tools to get make](https://developer.apple.com/xcode/features/)
13
+
* Windows: [Click here for installation instructions](http://gnuwin32.sourceforge.net/packages/make.htm)
14
+
* gcc/g++ >= 5.4
15
+
* Linux: gcc / g++ is installed by default on most Linux distros
16
+
* Mac: same deal as make - [install Xcode command line tools](https://developer.apple.com/xcode/features/)
17
+
* Windows: recommend using [MinGW](http://www.mingw.org/)
* Mac: There is a [homebrew installation available](https://formulae.brew.sh/formula/wxmac).
21
+
* Installation instructions can be found [here](https://wiki.wxwidgets.org/Install). Some version numbers may need to be changed in instructions to install v3.0 or greater.
22
+
23
+
## Basic Build Instructions
24
+
25
+
1. Clone this repo.
26
+
2. Make a build directory in the top level directory: `mkdir build && cd build`
<TYPE:NODE><ID:0><ANSWER:Welcome! My name is MemBot. You can ask me about things related to memory management in C++. Possible topics are 'pointers' and 'the C++ memory model'. What would you like to talk about?>
4
+
5
+
<TYPE:NODE><ID:1><ANSWER:Great! Let's talk about pointers. In computer science, a pointer is a special value whose meaning is a memory address. This address can contain either data, such as variables or objects, but also program codes (instructions). By dereferencing the pointer it is possible to access the data or the code. Among other things, pointers are used to manage dynamic memory. Other topics around pointers you can ask about are 'smart pointers' and 'nullptr'>
6
+
7
+
<TYPE:NODE><ID:2><ANSWER:When instantiating variables, programmers can choose wether to do this on the heap, on the stack or in static memory. Do you want to know more about those two concepts? Simply ask me about 'heap', 'stack' or 'static'.>
8
+
9
+
<TYPE:NODE><ID:3><ANSWER:A smart pointer is an object that behaves like a pointer, i.e. it must support pointer operations such as dereferencing or indirect access. In addition to these properties, the smart pointer handles resources better. In concrete terms, this means that it takes care not to cause a memory leak. A smart pointer exists in various flavors, which are unique_ptr, shared_ptr and weak_ptr. There are no more topics in this section, starting over!>
10
+
11
+
<TYPE:NODE><ID:4><ANSWER:The value nullptr can be assigned to pointers of any type. This turns the pointer into a null pointer that does not point to a memory location. The nullptr keyword can be used to test if a pointer or handle reference is null before the reference is used. There are no more topics in this section, starting over!>
12
+
13
+
<TYPE:NODE><ID:5><ANSWER:Local variables declared as part of a function are stored on the stack. Also, the stack is the place where function parameters are stored. Further, the stack is used for storing the return address of the calling functions, and it keeps the register contents and return address when an interrupt service routine is called. -- There are no more topics in this section, starting over!>
14
+
15
+
<TYPE:NODE><ID:6><ANSWER:Heap memory, also known as dynamic memory, is an alternative to local stack memory. Local memory is allocated automatically on function call and it is deallocated automatically when a function exits. Heap memory is different. The programmer explicitly requests the allocation of a memory block of a particular size, and the block continues to be allocated until the programmer explicitly requests that it be deallocated. -- There are no more topics in this section, starting over!>
16
+
17
+
<TYPE:NODE><ID:7><ANSWER:Static memory persists throughout the entire life of the program, and is usually used to store things like global variables, or variables created with the static clause. -- There are no more topics in this section, starting over!>
0 commit comments