t141.py

00001 # This file is Copyright 2003, 2006, 2007, 2009 Dean Hall.
00002 #
00003 # This file is part of the Python-on-a-Chip program.
00004 # Python-on-a-Chip is free software: you can redistribute it and/or modify
00005 # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
00006 #
00007 # Python-on-a-Chip is distributed in the hope that it will be useful,
00008 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00010 # A copy of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
00011 # is seen in the file COPYING up one directory from this.
00012 
00013 #
00014 # System Test 141
00015 # String cache not handled by GC
00016 #
00017 # Creates a bunch of strings, removes references to them,
00018 # creates another bunch of strings causing a GC.
00019 # Expect enough space for the second bunch of strings.
00020 # This test is tuned for an 8 KB heap.
00021 #
00022 
00023 import sys
00024 
00025 print "Heap =", sys.heap()
00026 
00027 start = ord('a')
00028 r = map(chr, range(start, start+36))
00029 t = map(type, r)
00030 print "r = ", r
00031 print "t = ", t
00032 print "Heap =", sys.heap()
00033 
00034 start = ord('A')
00035 r = map(chr, range(start, start+36))
00036 print "r = ", r
00037 print "Heap =", sys.heap()
00038 
00039 print "Done."

Generated on Mon Oct 18 07:40:47 2010 for Python-on-a-chip by  doxygen 1.5.9