How to delete object?

I need to create a method of class that delete the instance. I want to know if there is any possible solution (even if it is not recommended) how to do this. Instance of this class will be stored in hundreds of different class. I will try to describe this, for example there will be … Read more

Valgrind complains with “Invalid write of size 8”

This looks wrong: Should probably be: (spaces added for convenience). EDIT: Some additional explanation: When you say return_data[i]=… you are trying to write something into return_data[i]. Now, return_data is char**, so return_data[i] is char*. So you are writing a pointer into some location in memory. It looks like your pointers are 8 bytes long (which is fine), but you’ve only allocated 6 bytes: MAX_SOURCE_STRING+1. So … Read more

Calculating Page Table Size

Since we have a virtual address space of 2^32 and each page size is 2^12, we can store (2^32/2^12) = 2^20 pages. Since each entry into this page table has an address of size 4 bytes, then we have 2^20*4 = 4MB. So the page table takes up 4MB in memory.