harpoon.Analysis.MemOpt
Class PreallocAllocationStrategy

java.lang.Object
  extended by harpoon.Backend.Runtime1.AllocationStrategy
      extended by harpoon.Backend.Runtime1.MallocAllocationStrategy
          extended by harpoon.Backend.Runtime1.BDWAllocationStrategy
              extended by harpoon.Analysis.MemOpt.PreallocAllocationStrategy
All Implemented Interfaces:
Serializable

public class PreallocAllocationStrategy
extends BDWAllocationStrategy

PreallocAllocationStrategy is the allocation strategy for the Static Memory Preallocation Optimization (via Ovy's Incompatibility Analysis). When asked to generate code that allocates memory for an allocation site, it behaves as follows:

Version:
$Id: PreallocAllocationStrategy.java,v 1.7 2003/03/07 20:57:20 salcianu Exp $
Author:
Alexandru Salcianu <salcianu@MIT.edu>
See Also:
Serialized Form

Field Summary
 
Fields inherited from class harpoon.Backend.Runtime1.MallocAllocationStrategy
frame
 
Constructor Summary
PreallocAllocationStrategy(Frame f)
          Creates a PreallocAllocationStrategy.
 
Method Summary
 Exp memAlloc(TreeFactory tf, HCodeElement source, DerivationGenerator dg, AllocationInformation.AllocationProperties ap, Exp length)
          Return a Tree.Exp created with the given TreeFactory that returns a pointer to a piece of memory length bytes long.
 
Methods inherited from class harpoon.Backend.Runtime1.MallocAllocationStrategy
buildAllocCall, DECLARE, DECLARE
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreallocAllocationStrategy

public PreallocAllocationStrategy(Frame f)
Creates a PreallocAllocationStrategy.

Method Detail

memAlloc

public Exp memAlloc(TreeFactory tf,
                    HCodeElement source,
                    DerivationGenerator dg,
                    AllocationInformation.AllocationProperties ap,
                    Exp length)
Description copied from class: AllocationStrategy
Return a Tree.Exp created with the given TreeFactory that returns a pointer to a piece of memory length bytes long.

Overrides:
memAlloc in class BDWAllocationStrategy