* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: slab.c,v 1.6 2002/09/07 15:13:02 chorns Exp $
+/* $Id: slab.c,v 1.7 2002/09/08 10:23:36 chorns Exp $
*
* COPYRIGHT: See COPYING in the top directory
* PROJECT: ReactOS kernel
/* INCLUDES *****************************************************************/
-#include <ntoskrnl.h>
+#include <ddk/ntddk.h>
+#include <internal/mm.h>
#define NDEBUG
#include <internal/debug.h>
-
/* TYPES ********************************************************************/
typedef VOID (*SLAB_CACHE_CONSTRUCTOR)(VOID*, ULONG);
AlignSize = Align - (ObjectSize % Align);
Slab->ObjectSize = ObjectSize + AlignSize;
Slab->ObjectsPerPage =
- (PAGE_SIZE - sizeof(SLAB_CACHE_PAGE)) / Slab->ObjectSize;
+ (PAGESIZE - sizeof(SLAB_CACHE_PAGE)) / Slab->ObjectSize;
InitializeListHead(&Slab->PageListHead);
KeInitializeSpinLock(&Slab->SlabLock);
return(NULL);
}
- SlabPage = (PSLAB_CACHE_PAGE)(Page + PAGE_SIZE - sizeof(SLAB_CACHE_PAGE));
+ SlabPage = (PSLAB_CACHE_PAGE)(Page + PAGESIZE - sizeof(SLAB_CACHE_PAGE));
SlabPage->ReferenceCount = 0;
SlabPage->FirstFreeBuffer = (PSLAB_CACHE_BUFCTL)Page;
for (i = 0; i < Slab->ObjectsPerPage; i++)
current = CONTAINING_RECORD(current_entry,
SLAB_CACHE_PAGE,
PageListEntry);
- Base = (PVOID)current + sizeof(SLAB_CACHE_PAGE) - PAGE_SIZE;
+ Base = (PVOID)current + sizeof(SLAB_CACHE_PAGE) - PAGESIZE;
if (Base >= Object &&
- (Base + PAGE_SIZE - sizeof(SLAB_CACHE_PAGE)) >=
+ (Base + PAGESIZE - sizeof(SLAB_CACHE_PAGE)) >=
(Object + Slab->ObjectSize))
{
ExFreeFromPageSlabCache(Slab, current, Object);
current = CONTAINING_RECORD(current_entry,
SLAB_CACHE_PAGE,
PageListEntry);
- Base = (PVOID)current + sizeof(SLAB_CACHE_PAGE) - PAGE_SIZE;
+ Base = (PVOID)current + sizeof(SLAB_CACHE_PAGE) - PAGESIZE;
if (Slab->Destructor != NULL)
{
for (i = 0; i < Slab->ObjectsPerPage; i++)