[ros-diffs] [tkreuzer] 56462: [WIN32K] Use user mode mem for bitmaps larger than 4K to save pool memory.

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Tue May 1 12:47:22 UTC 2012


Author: tkreuzer
Date: Tue May  1 12:47:21 2012
New Revision: 56462

URL: http://svn.reactos.org/svn/reactos?rev=56462&view=rev
Log:
[WIN32K]
Use user mode mem for bitmaps larger than 4K to save pool memory.

Modified:
    trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c

Modified: trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c?rev=56462&r1=56461&r2=56462&view=diff
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c [iso-8859-1] Tue May  1 12:47:21 2012
@@ -143,7 +143,7 @@
     IN OPTIONAL LPBYTE pUnsafeBits)
 {
     HBITMAP hbmp;
-    ULONG cRealBpp, cjWidthBytes, iFormat;
+    ULONG cRealBpp, cjWidthBytes, iFormat, fjBitmap;
     ULONGLONG cjSize;
     PSURFACE psurf;
 
@@ -164,13 +164,16 @@
         EngSetLastError(ERROR_INVALID_PARAMETER);
         return NULL;
     }
+
+    /* Allocations larger than PAGE_SIZE go into user mem */
+    fjBitmap = (cjSize > PAGE_SIZE) ? BMF_USERMEM : 0;
 
     /* Allocate the surface (but don't set the bits) */
     psurf = SURFACE_AllocSurface(STYPE_BITMAP,
                                  nWidth,
                                  nHeight,
                                  iFormat,
-                                 0,
+                                 fjBitmap,
                                  0,
                                  NULL);
     if (!psurf)




More information about the Ros-diffs mailing list