Torque3D Documentation / _generateds / x86UNIXMemory.cpp

x86UNIXMemory.cpp

Engine/source/platformX86UNIX/x86UNIXMemory.cpp

More...

Public Functions

void *
dMalloc_aligned(dsize_t in_size, int alignment)
dMemcmp(const void * ptr1, const void * ptr2, dsize_t len)
void *
dMemcpy(void * dst, const void * src, dsize_t size)
void *
dMemmove(void * dst, const void * src, dsize_t size)
void *
dMemset(void * dst, S32 c, dsize_t size)

Detailed Description

Public Functions

dFree_aligned(void * p)

dMalloc_aligned(dsize_t in_size, int alignment)

dMemcmp(const void * ptr1, const void * ptr2, dsize_t len)

dMemcpy(void * dst, const void * src, dsize_t size)

dMemmove(void * dst, const void * src, dsize_t size)

dMemset(void * dst, S32 c, dsize_t size)

dRealFree(void * p)

dRealMalloc(dsize_t s)

 1
 2//-----------------------------------------------------------------------------
 3// Copyright (c) 2012 GarageGames, LLC
 4//
 5// Permission is hereby granted, free of charge, to any person obtaining a copy
 6// of this software and associated documentation files (the "Software"), to
 7// deal in the Software without restriction, including without limitation the
 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 9// sell copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21// IN THE SOFTWARE.
22//-----------------------------------------------------------------------------
23
24#include "platformX86UNIX/platformX86UNIX.h"
25#include <stdlib.h>
26#include <mm_malloc.h>
27
28void* dMemcpy(void *dst, const void *src, dsize_t size)
29{
30   return memcpy(dst,src,size);
31}
32
33//--------------------------------------
34void* dMemmove(void *dst, const void *src, dsize_t size)
35{
36   return memmove(dst,src,size);
37}
38
39//--------------------------------------
40void* dMemset(void *dst, S32 c, dsize_t size)
41{
42   return memset(dst,c,size);
43}
44
45//--------------------------------------
46S32 dMemcmp(const void *ptr1, const void *ptr2, dsize_t len)
47{
48   return memcmp(ptr1, ptr2, len);
49}
50
51void* dRealMalloc(dsize_t s)
52{
53   return malloc(s);
54}
55
56void dRealFree(void* p)
57{
58   free(p);
59}
60
61void *dMalloc_aligned(dsize_t in_size, int alignment)
62{
63   return _mm_malloc(in_size, alignment);
64}
65
66void dFree_aligned(void* p)
67{
68   return _mm_free(p);
69}
70