harpoon.Backend.Runtime1
Class MallocAllocationStrategy

java.lang.Object
  extended by harpoon.Backend.Runtime1.AllocationStrategy
      extended by harpoon.Backend.Runtime1.MallocAllocationStrategy
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BDWAllocationStrategy, HeapStatsAllocationStrategy, InstrumentedAllocationStrategy, NiftyAllocationStrategy, RealtimeAllocationStrategy, SPAllocationStrategy

public class MallocAllocationStrategy
extends AllocationStrategy

MallocAllocationStrategy calls a C function with the same prototype as malloc() to do the allocation.

Version:
$Id: MallocAllocationStrategy.java,v 1.2 2002/02/25 21:02:20 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Serialized Form

Field Summary
protected  Frame frame
           
 
Constructor Summary
MallocAllocationStrategy(Frame f, String funcname)
          Creates a MallocAllocationStrategy.
 
Method Summary
protected  Exp buildAllocCall(TreeFactory tf, HCodeElement source, DerivationGenerator dg, AllocationInformation.AllocationProperties ap, String funcname, Exp length, ExpList addlArgs)
           
protected static Exp DECLARE(DerivationGenerator dg, HClass hc, Exp exp)
           
protected static Exp DECLARE(DerivationGenerator dg, HClass hc, Temp t, Exp exp)
           
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frame

protected final Frame frame
Constructor Detail

MallocAllocationStrategy

public MallocAllocationStrategy(Frame f,
                                String funcname)
Creates a MallocAllocationStrategy.

Parameters:
funcname - The name of the C function to call to do the allocation.
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.

Specified by:
memAlloc in class AllocationStrategy

buildAllocCall

protected Exp buildAllocCall(TreeFactory tf,
                             HCodeElement source,
                             DerivationGenerator dg,
                             AllocationInformation.AllocationProperties ap,
                             String funcname,
                             Exp length,
                             ExpList addlArgs)

DECLARE

protected static Exp DECLARE(DerivationGenerator dg,
                             HClass hc,
                             Exp exp)

DECLARE

protected static Exp DECLARE(DerivationGenerator dg,
                             HClass hc,
                             Temp t,
                             Exp exp)