Page 85 - DCAP408_WEB_PROGRAMMING
P. 85

Dr. Anil Sharma, Lovely Professional University                            Unit 5: Memory Management (I)





                           Unit 5: Memory Management (I)                                        Notes


            CONTENTS
            Objectives
            Introduction

            5.1  Local vs Global Memory
                 5.1.1  Global Memory
                 5.1.2  Local Memory

            5.2  Local Memory Blocks
            5.3  Using Fixed Memory Blocks
                 5.3.1  Fixed Size Memory Management Configuration
            5.4  Changing the Size of a Memory Block
            5.5  Using LocalReAlloc()

                 5.5.1  Parameters
                 5.5.2  Return Values
            5.6  Discardable Memory Blocks

            5.7  Summary
            5.8  Keywords
            5.9  Review Questions
            5.10 Further Readings

          Objectives

          After studying this unit, you will be able to:

              Understand local vs global memory
              Discuss local memory blocks

              Understand using fixed memory blocks
              Discuss changing the size of the memory block
              Illustrate using LocalReAlloc()
              Discuss discardable memory blocks

          Introduction

          Memory management under Win32 from the application’s  standpoint is pretty simple and
          uncomplicated. Each process possesses a 4 GB memory address space. The memory model used
          is known as a flat memory model. In this model, all segment registers (or selectors) point to the
          similar beginning address and the offset is 32-bit so an application can use memory at any point
          in its own address space without the requirement to modify the value of selectors. This shortens
          memory management a lot. There’s no “near” or “far” pointer any longer.




                                           LOVELY PROFESSIONAL UNIVERSITY                                   79
   80   81   82   83   84   85   86   87   88   89   90