1 cananian 1.1.2.1 // NullAllocationStrategy.java, created Wed Oct 13 12:55:23 1999 by cananian
 2 cananian 1.1.2.1 // Copyright (C) 1999 C. Scott Ananian <cananian@alumni.princeton.edu>
 3 cananian 1.1.2.1 // Licensed under the terms of the GNU GPL; see COPYING for details.
 4 cananian 1.1.2.1 package harpoon.Backend.Runtime1;
 5 cananian 1.1.2.1 
 6 cananian 1.1.2.3 import harpoon.Analysis.Maps.AllocationInformation.AllocationProperties;
 7 cananian 1.1.2.1 import harpoon.ClassFile.HCodeElement;
 8 cananian 1.1.2.1 import harpoon.IR.Tree.CONST;
 9 cananian 1.1.2.2 import harpoon.IR.Tree.DerivationGenerator;
10 cananian 1.1.2.1 import harpoon.IR.Tree.Exp;
11 cananian 1.1.2.1 import harpoon.IR.Tree.TreeFactory;
12 cananian 1.1.2.1 /**
13 cananian 1.1.2.1  * <code>NullAllocationStrategy</code> just returns a null pointer
14 cananian 1.1.2.1  * when asked for memory.  It's just a stub, really.
15 cananian 1.1.2.1  * 
16 cananian 1.1.2.1  * @author  C. Scott Ananian <cananian@alumni.princeton.edu>
17 cananian 1.2      * @version $Id: NullAllocationStrategy.java,v 1.2 2002/02/25 21:02:20 cananian Exp $
18 cananian 1.1.2.1  */
19 cananian 1.1.2.1 public class NullAllocationStrategy extends AllocationStrategy {
20 cananian 1.1.2.1     /** Creates a <code>NullAllocationStrategy</code>. */
21 cananian 1.1.2.1     public NullAllocationStrategy() { }
22 cananian 1.1.2.1 
23 cananian 1.1.2.2     public Exp memAlloc(TreeFactory tf, HCodeElement source,
24 cananian 1.1.2.3                         DerivationGenerator dg, AllocationProperties ap,
25 cananian 1.1.2.3                         Exp length) {
26 cananian 1.1.2.1         return new CONST(tf, source); // null pointer.
27 cananian 1.1.2.1     }
28 cananian 1.2     }