📄 osapi_memory.c
字号:
/*****************************************************************************
******************************************************************************
** **
** Copyright (c) 2006 Videon Central, Inc. **
** All rights reserved. **
** **
** The computer program contained herein contains proprietary information **
** which is the property of Videon Central, Inc. The program may be used **
** and/or copied only with the written permission of Videon Central, Inc. **
** or in accordance with the terms and conditions stipulated in the **
** agreement/contract under which the programs have been supplied. **
** **
******************************************************************************
*****************************************************************************/
/**
* @file osapi_memory.cpp
*
* $Revision: 1.5 $
*
* Operating System API (OSAPI) source file. Provides an abstraction from the
* operating system.
*
* This is the implementation for win32
*
*/
#include "osapi.h"
#include "dbgprint.h"
#include <stdlib.h>
PVOID OS_MemAlloc(ULONG ulSize)
{
PVOID pvMemory = NULL;
if (ulSize == 0)
{
DbgPrint(("OS_MemAlloc: Memory size is 0!\n"));
return (NULL);
}
pvMemory = malloc(ulSize);
DbgAssert(pvMemory != NULL);
return (pvMemory);
}
OS_STATUS OS_MemFree(PVOID pvMemory)
{
if (pvMemory == NULL)
{
DbgPrint(("OS_MemFree: Memory pointer is NULL!\n"));
return (OS_NULL_POINTER);
}
free(pvMemory);
return (OS_OK);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -