5e087561a50f4c26728a7a5b0fbc7746122a923evboxsync/* $Id$ */
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync/** @file
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync * kHlpAlloc - Memory Allocation, IPRT based implementation.
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync */
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync/*
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync * Copyright (C) 2007-2010 Oracle Corporation
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync *
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync * available from http://www.virtualbox.org. This file is free software;
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync * you can redistribute it and/or modify it under the terms of the GNU
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * General Public License (GPL) as published by the Free Software
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync */
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync/*******************************************************************************
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync* Header Files *
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync*******************************************************************************/
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync#include <k/kHlpAlloc.h>
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync#include <iprt/mem.h>
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync#include <iprt/string.h>
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncKHLP_DECL(void *) kHlpAlloc(KSIZE cb)
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync{
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync return RTMemAlloc(cb);
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync}
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncKHLP_DECL(void *) kHlpAllocZ(KSIZE cb)
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync{
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync return RTMemAllocZ(cb);
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync}
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncKHLP_DECL(void *) kHlpDup(const void *pv, KSIZE cb)
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync{
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync return RTMemDup(pv, cb);
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync}
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncKHLP_DECL(char *) kHlpStrDup(const char *psz)
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync{
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync return RTStrDup(psz);
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync}
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncKHLP_DECL(void *) kHlpRealloc(void *pv, KSIZE cb)
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync{
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync return RTMemRealloc(pv, cb);
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync}
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncKHLP_DECL(void) kHlpFree(void *pv)
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync{
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync RTMemFree(pv);
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync}
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync