mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 13:06:34 +00:00
[CMLIB]: Use the generic allocator functions, and fix build.
svn path=/trunk/; revision=75159
This commit is contained in:
parent
903ac43860
commit
04201ba762
2 changed files with 7 additions and 5 deletions
|
@ -722,13 +722,13 @@ CmpAllocate(
|
||||||
IN SIZE_T Size,
|
IN SIZE_T Size,
|
||||||
IN BOOLEAN Paged,
|
IN BOOLEAN Paged,
|
||||||
IN ULONG Tag
|
IN ULONG Tag
|
||||||
);
|
);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CmpFree(
|
CmpFree(
|
||||||
IN PVOID Ptr,
|
IN PVOID Ptr,
|
||||||
IN ULONG Quota
|
IN ULONG Quota
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif /* _CMLIB_H_ */
|
#endif /* _CMLIB_H_ */
|
||||||
|
|
|
@ -569,7 +569,9 @@ HvTrackCellRef(
|
||||||
if (CellRef->Count == CellRef->Max)
|
if (CellRef->Count == CellRef->Max)
|
||||||
{
|
{
|
||||||
/* Allocate a new reference table */
|
/* Allocate a new reference table */
|
||||||
NewCellArray = ExAllocatePoolWithTag(PagedPool, (CellRef->Max + CELL_REF_INCREMENT) * sizeof(HV_HIVE_CELL_PAIR), TAG_CM);
|
NewCellArray = CmpAllocate((CellRef->Max + CELL_REF_INCREMENT) * sizeof(HV_HIVE_CELL_PAIR),
|
||||||
|
TRUE,
|
||||||
|
TAG_CM);
|
||||||
if (!NewCellArray)
|
if (!NewCellArray)
|
||||||
{
|
{
|
||||||
DPRINT1("HvTrackCellRef: Cannot reallocate the reference table.\n");
|
DPRINT1("HvTrackCellRef: Cannot reallocate the reference table.\n");
|
||||||
|
@ -585,7 +587,7 @@ HvTrackCellRef(
|
||||||
RtlCopyMemory(NewCellArray,
|
RtlCopyMemory(NewCellArray,
|
||||||
CellRef->CellArray,
|
CellRef->CellArray,
|
||||||
CellRef->Max * sizeof(HV_HIVE_CELL_PAIR));
|
CellRef->Max * sizeof(HV_HIVE_CELL_PAIR));
|
||||||
ExFreePoolWithTag(CellRef->CellArray, TAG_CM);
|
CmpFree(CellRef->CellArray, 0); // TAG_CM
|
||||||
}
|
}
|
||||||
CellRef->CellArray = NewCellArray;
|
CellRef->CellArray = NewCellArray;
|
||||||
CellRef->Max += CELL_REF_INCREMENT;
|
CellRef->Max += CELL_REF_INCREMENT;
|
||||||
|
@ -643,7 +645,7 @@ HvReleaseFreeCellRefArray(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We can reuse the dynamic array */
|
/* We can reuse the dynamic array */
|
||||||
ExFreePoolWithTag(CellRef->CellArray, TAG_CM);
|
CmpFree(CellRef->CellArray, 0); // TAG_CM
|
||||||
CellRef->CellArray = NULL;
|
CellRef->CellArray = NULL;
|
||||||
CellRef->Count = CellRef->Max = 0;
|
CellRef->Count = CellRef->Max = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue