OSDN Git Service

Modified: doc
[eos/optional.git] / doc / Objects / Memory.html
1 <HR>
2 <A NAME="Information">
3 <H2>Information from source codes</H2>
4 </A>
5 <PRE>
6 </PRE>
7 <HR>
8 <A NAME="include">
9 <H2>Memory.h</H2>
10 </A>
11 <PRE>
12 #ifndef MEMORY_H
13 #define MEMORY_H
14
15 #include <stdio.h>
16 #include <limits.h>
17 #include <stdlib.h>
18
19 #define MemoryAllocate(type,num,message) (type*)memoryAllocate(sizeof(type)*(num),message)
20
21 /* struct begin */
22 typedef void* Memory;
23
24 /* struct end */
25
26 /* prototype begin */
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 extern Memory memoryAllocate(size_t byte, char* message);
32
33 /* This function must be created later in memory object. */
34
35 #define memoryFree(ptr) free(ptr)
36
37 extern Memory memoryCopy(Memory dst, Memory src, size_t byte);
38 extern Memory memoryDuplicate(Memory src, size_t byte);
39
40 extern Memory memoryClear(Memory src, size_t, char n);
41
42 extern Memory memoryByteSwap(Memory src, size_t, int n);
43
44 /* prototype end */
45
46 #ifdef __cplusplus
47 };
48 #endif
49
50 #endif /* MEMORY_H */
51 </PRE>