#ifndef _aplmt_memory_thinallocapi_h_ #define _aplmt_memory_thinallocapi_h_ /*---------------------------------------------------------------------------- ** SUMMARY: Thread Safe Thin Memory Allocation (MEMTHINMT) ** ** This file provides thread-safe extensions to the basic APL MEMTHIN ** interface. The application must 'build' the basic MEMTHIN interface and ** follow all of the setup/configuration specified for that interface. This ** MT interface can be used in 'parallel' (i.e. co-exist) with other Memory ** interfaces (threaded or non-threaded). In fact, it is technically OK ** to mix the calls to the the basic MEMTHIN interfaces with calls to this ** interface (MEMTHINMT), JUST BE SURE YOU KNOW WHAT YOU ARE DOING. ** ** HEAP-SIZE ** --------- ** See apl/memory/thinallocapi.h ** ** OUT-OF-MEMORY ** ------------- ** See apl/memory/thinallocapi.h ** ** MEMORY ALIGNMENT ** ---------------- ** See apl/memory/thinallocapi.h ** ** ** CONFIGURATION ** ------------- ** COMPILE: See apl/memory/thinallocapi.h ** ** APPLICATION: See apl/memory/thinallocapi.h ** ** PLATFORM: none. ** ** ** NOTES: ** 1. Unless explicitly stated otherwise, NONE of the following methods may be ** called from interrupt service routines. ** 2. Unless explicitly stated otherwise, NONE of the following methods may be ** called before the platform's kernel is running. ** 3. Unless explicitly stated otherwise, all of the following methods ARE ** thread-safe. ** 4. For efficency/optimization some methods are 'inlined'. The inlining ** is done by using the preprocessor/macros. The application should ** treat all methods as function calls and not rely on the fact they may ** be currently defined as macros. ----------------------------------------------------------------------------*/ #include "apl/memory/thinallocapi.h" /* For: parent/base interface */ #ifdef __cplusplus extern "C" { #endif /*-------------- INLINE IMPLEMENTATION -------------------------------------*/ #include "aplmt/memory/thinalloc.h" /* For: inline MT implementation */ /*-------------- INHERITED PARENT API --------------------------------------*/ /** The parent/base API methods are enumerated below. The inherited methods are NOT thread-safe. For a up-to-date list reference the parent class directly. Prototypes: void* Apl_allocate( AplSize_t numBytes ); */ /*-------------- PUBLIC/PUBLISHED API --------------------------------------*/ /** This method is a thread-safe version of Apl_allocate(). NOTES: o This method can ONLY be called once the kernel is running. o This method is thread-safe, and as such may: block on a mutex, disable scheduling, or disable interrupts for the duration of the call (it is platform dependent). o As a general rule, do NOT mix calls to the non-thread safe and thread safe version of alloc. The ONLY exception to this rule is during start-up. It is OK, to call the non-thread safe version of alloc before the kernel is started, and then the thread-safe version once the kernel is running. Prototype: void* Aplmt_allocate( AplSize_t numBytes ); */ #define Aplmt_allocate _Aplmt_allocate #ifdef __cplusplus } #endif /*--------------------------------------------------------------------------*/ #endif /* end _aplmt_memory_thinallocapi_h_ */