git.ucc.asn.au
/
tpg
/
acess2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Usermode/Libs - x86_64 port in progress
[tpg/acess2.git]
/
Modules
/
Interfaces
/
UDI
/
mem.c
1
/**
2
* \file mem.c
3
* \author John Hodge (thePowersGang)
4
*/
5
#include <acess.h>
6
#include <udi.h>
7
8
// === EXPORTS ===
9
EXPORT(udi_mem_alloc);
10
EXPORT(udi_mem_free);
11
12
// === CODE ===
13
void udi_mem_alloc(
14
udi_mem_alloc_call_t *callback,
15
udi_cb_t *gcb,
16
udi_size_t size,
17
udi_ubit8_t flags
18
)
19
{
20
void *buf = malloc(size);
21
if(buf)
22
{
23
if( !(flags & UDI_MEM_NOZERO) )
24
memset(buf, 0, size);
25
}
26
callback(gcb, buf);
27
}
28
29
void udi_mem_free(void *target_mem)
30
{
31
free(target_mem);
32
}
UCC
git Repository :: git.ucc.asn.au