1    /* --COPYRIGHT--,ESD
     2     *  Copyright (c) 2008 Texas Instruments. All rights reserved. 
     3     *  This program and the accompanying materials are made available under the 
     4     *  terms of the Eclipse Public License v1.0 and Eclipse Distribution License
     5     *  v. 1.0 which accompanies this distribution. The Eclipse Public License is
     6     *  available at http://www.eclipse.org/legal/epl-v10.html and the Eclipse
     7     *  Distribution License is available at 
     8     *  http://www.eclipse.org/org/documents/edl-v10.php.
     9     *
    10     *  Contributors:
    11     *      Texas Instruments - initial implementation
    12     * --/COPYRIGHT--*/
    13    /*
    14     *  ======== HeapNull.xdc ========
    15     */
    16    
    17    import xdc.runtime.Error;
    18    
    19    /*!
    20     *  ======== HeapNull ========
    21     *  Empty heap
    22     */
    23    module HeapNull inherits xdc.runtime.IHeap {
    24    
    25    instance:
    26    
    27        /*!
    28         *  ======== create ========
    29         *  Create a `HeapNull` heap
    30         *
    31         *  This heap is an always empty heap that is intended to be used by
    32         *  systems that never allocate objects or free memory but need a heap
    33         *  to satisfy linkage requirements of third-party libraries.
    34         */
    35        create();
    36        
    37        /*!
    38         *  ======== alloc ========
    39         *  Allocate a block of memory from the heap.
    40         *
    41         *  `HeapNull_alloc()` always fails.  
    42         */
    43        override Ptr alloc(SizeT size, SizeT align, Error.Block *eb);    
    44    
    45        /*!
    46         *  ======== free ========
    47         *  Free a block of memory back to the heap.
    48         *
    49         *  Calling the `HeapNull_free` function has no effect.
    50         */
    51        override Void free(Ptr block, SizeT size);
    52        
    53        /*!
    54         *  ======== isBlocking ========
    55         *  Can this heap block the caller
    56         *
    57         *  @a(returns)
    58         *  `HeapNull` always returns `FALSE` since it never blocks on a
    59         *  resource.
    60         */
    61        override Bool isBlocking();    
    62    
    63    internal:
    64        /*!
    65         *  ======== Instance_State ========
    66         */
    67        struct Instance_State { /* nothing needed for this implementation */
    68        };
    69    }