MDL-13237 rceche limiting through intcachemax finally implemented - this should prevent major memory leaks

This commit is contained in:
skodak
2008-01-29 17:29:39 +00:00
parent 6f36f19a62
commit b8a2e4a095
+6
View File
@@ -2566,6 +2566,12 @@ function rcache_set($table, $id, $rec) {
global $CFG, $MCACHE, $rcache;
if ($CFG->cachetype === 'internal') {
if (!isset($rcache->data[$table])) {
$rcache->data[$table] = array();
}
if (!isset($rcache->data[$table][$id]) and count($rcache->data[$table]) > $CFG->intcachemax) {
array_shift($rcache->data[$table]);
}
$rcache->data[$table][$id] = clone($rec);
} else {
$key = $table . '|' . $id;