Page 91 - DCAP408_WEB_PROGRAMMING
P. 91

Unit 5: Memory Management (I)




          It defines the address of the memory pool.                                            Notes
          Return value:
          It indicates the pointer to newly assigned memory block or NULL on failure.
          Description:

          Function  assigns  a  memory  block  in  stated  memory  pool.  Block  size  is  stated  during
          memory  pool  initialization.  Allocated addresses  are  always  allocated  to  value stated  in
          AR_MEMORY_ALIGNMENT, comparatively to start of the memory pool. If function successes,
          it return pointer to newly assigned memory block. On failure, it returns a  NULL. Function do
          not sets the previous error code on failure. Access to the fixed memory is never synchronized. If
          it is compulsory it should be executed.
          Function will be expelled from compilation when functions accountable for fixed size memory
          management are disabled, by setting ST_USE_FIXMEM for 0.

          stFixedMemFree function

          Declaration:
          BOOL  stFixedMemFree(
              PVOID  MemoryPool,
              PVOID  Address
          );
          Parameters:
          MemoryPool
          It defines the address of memory pool.

          Address


          It indicates the address of the block to release.

          Return value:
          TRUE on success or FALSE on failure.
          Description:
          Function releases memory block assigned by stFixedMemAlloc function. It does not set the last
          error code on failure. Access to the fixed memory is never coordinated. If it is compulsory that
          it should be implemented.

          Function will be expelled from compilation when functions accountable for memory management
          are disabled, by setting ST_USE_FIXMEM for 0.

          stFixedMemInit function

          Declaration:
          BOOL  stFixedMemInit(
              PVOID  MemoryPool,
              SIZE  MemorySize,





                                           LOVELY PROFESSIONAL UNIVERSITY                                   85
   86   87   88   89   90   91   92   93   94   95   96