? includes/memory.inc
Index: index.php
===================================================================
RCS file: /cvs/drupal/drupal/index.php,v
retrieving revision 1.94
diff -u -F^f -r1.94 index.php
--- index.php	26 Dec 2007 08:46:48 -0000	1.94
+++ index.php	30 Sep 2009 18:31:29 -0000
@@ -12,6 +12,10 @@
  * See COPYRIGHT.txt and LICENSE.txt.
  */
 
+include_once './includes/memory.inc';
+memory_put('total');
+
+memory_put('bootstrap');
 require_once './includes/bootstrap.inc';
 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
 
@@ -37,3 +41,7 @@
 }
 
 drupal_page_footer();
+
+memory_put('total');
+memory_shutdown();
+
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.756.2.71
diff -u -F^f -r1.756.2.71 common.inc
--- includes/common.inc	23 Sep 2009 09:09:29 -0000	1.756.2.71
+++ includes/common.inc	30 Sep 2009 18:31:31 -0000
@@ -2609,6 +2609,7 @@ function _drupal_bootstrap_full() {
   module_load_all();
   // Let all modules take action before menu system handles the request
   // We do not want this while running update.php.
+  memory_put('bootstrap');
   if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update') {
     module_invoke_all('init');
   }
Index: includes/module.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/module.inc,v
retrieving revision 1.115.2.1
diff -u -F^f -r1.115.2.1 module.inc
--- includes/module.inc	16 Feb 2009 10:32:10 -0000	1.115.2.1
+++ includes/module.inc	30 Sep 2009 18:31:32 -0000
@@ -11,7 +11,9 @@
  */
 function module_load_all() {
   foreach (module_list(TRUE, FALSE) as $module) {
+    memory_put('code', $module);
     drupal_load('module', $module);
+    memory_put('code', $module);
   }
 }
 
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.415.2.24
diff -u -F^f -r1.415.2.24 theme.inc
--- includes/theme.inc	18 Jun 2009 12:04:04 -0000	1.415.2.24
+++ includes/theme.inc	30 Sep 2009 18:31:33 -0000
@@ -167,12 +167,16 @@ function _init_theme($theme, $base_theme
     foreach ($base_theme as $base) {
       // Include the theme file or the engine.
       if (!empty($base->owner)) {
+        memory_put('code', $base->owner);
         include_once './'. $base->owner;
+        memory_put('code', $base->owner);
       }
     }
     // and our theme gets one too.
     if (!empty($theme->owner)) {
+      memory_put('code', $theme->owner);
       include_once './'. $theme->owner;
+      memory_put('code', $theme->owner);
     }
   }
 
@@ -280,10 +284,14 @@ function _theme_process_registry(&$cache
       // files can prevent them from getting registered.
       if (isset($info['file']) && !isset($info['path'])) {
         $result[$hook]['file'] = $path .'/'. $info['file'];
+        memory_put('code', $result[$hook]['file']);
         include_once($result[$hook]['file']);
+        memory_put('code', $result[$hook]['file']);
       }
       elseif (isset($info['file']) && isset($info['path'])) {
+        memory_put('code', $info['path'] .'/'. $info['file']);
         include_once($info['path'] .'/'. $info['file']);
+        memory_put('code', $info['path'] .'/'. $info['file']);
       }
 
       if (isset($info['template']) && !isset($info['path'])) {
@@ -610,7 +618,9 @@ function theme() {
     if (isset($info['path'])) {
       $include_file = $info['path'] .'/'. $include_file;
     }
+    memory_put('code', $include_file);
     include_once($include_file);
+    memory_put('code', $include_file);
   }
   if (isset($info['function'])) {
     // The theme call is a function.
@@ -1017,7 +1027,9 @@ function theme_get_setting($setting_name
 function theme_render_template($template_file, $variables) {
   extract($variables, EXTR_SKIP);  // Extract the variables to a local namespace
   ob_start();                      // Start output buffering
+  memory_put('code', $template_file);
   include "./$template_file";      // Include the template file
+  memory_put('code', $template_file);
   $contents = ob_get_contents();   // Get the contents of the buffer
   ob_end_clean();                  // End buffering and discard
   return $contents;                // Return the contents
@@ -1575,6 +1587,7 @@ function theme_closure($main = 0) {
  *   A string containing the themed blocks for this region.
  */
 function theme_blocks($region) {
+  memory_put('blocks', $region);
   $output = '';
 
   if ($list = block_list($region)) {
@@ -1586,6 +1599,7 @@ function theme_blocks($region) {
 
   // Add any content assigned to this region through drupal_set_content() calls.
   $output .= drupal_get_content($region);
+  memory_put('blocks', $region);
 
   return $output;
 }
Index: themes/engines/phptemplate/phptemplate.engine
===================================================================
RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/phptemplate.engine,v
retrieving revision 1.69
diff -u -F^f -r1.69 phptemplate.engine
--- themes/engines/phptemplate/phptemplate.engine	2 Oct 2007 16:19:23 -0000	1.69
+++ themes/engines/phptemplate/phptemplate.engine	30 Sep 2009 18:31:33 -0000
@@ -9,7 +9,9 @@
 function phptemplate_init($template) {
   $file = dirname($template->filename) .'/template.php';
   if (file_exists($file)) {
+    memory_put('code', $file);
     include_once "./$file";
+    memory_put('code', $file);
   }
 }
 

