Wednesday, January 16, 2013

Memory allocation in .Net

In .Net the CLR allocates the memory in two different places: the Stack and the Heap.

  • In the Stack are saved the content of the Value Types variables and all the references to the instances of the Reference Types objects.
  • In the Heap are saved the Reference Type objects with all their content, including Value Types properties and references to instances that composes that object.

Let's illustrate this (remember that strings are a Reference Type too):




It may look complicated but it's really simple when you understand it.

Sunday, August 9, 2009

Configure CodeIgniter to allow debugging

Everytime i tried to debug with xdebug and codeigniter i get the error that it was not a valid url.
This happens because the debugger adds some parameters into the querystring.

To solve this problem i had to edit the config.php this way:
    
 $config['enable_query_strings'] = TRUE;   
 $config['permitted_uri_chars'] = '';   
 $config['uri_protocol'] = "PATH_INFO";   
   
Now you can debug and send all the parameters you want in the querystring.