OLD | NEW |
1 /* | 1 /* |
2 ****************************************************************************** | 2 ****************************************************************************** |
3 * | 3 * |
4 * Copyright (C) 1997-2012, International Business Machines | 4 * Copyright (C) 1997-2014, International Business Machines |
5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
6 * | 6 * |
7 ****************************************************************************** | 7 ****************************************************************************** |
8 * | 8 * |
9 * File CMEMORY.H | 9 * File CMEMORY.H |
10 * | 10 * |
11 * Contains stdlib.h/string.h memory functions | 11 * Contains stdlib.h/string.h memory functions |
12 * | 12 * |
13 * @author Bertrand A. Damiba | 13 * @author Bertrand A. Damiba |
14 * | 14 * |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 uprv_checkValidMemory(src, 1), \ | 52 uprv_checkValidMemory(src, 1), \ |
53 U_STANDARD_CPP_NAMESPACE memmove(dst, src, size)) | 53 U_STANDARD_CPP_NAMESPACE memmove(dst, src, size)) |
54 | 54 |
55 #else | 55 #else |
56 | 56 |
57 #define uprv_memcpy(dst, src, size) U_STANDARD_CPP_NAMESPACE memcpy(dst, src, si
ze) | 57 #define uprv_memcpy(dst, src, size) U_STANDARD_CPP_NAMESPACE memcpy(dst, src, si
ze) |
58 #define uprv_memmove(dst, src, size) U_STANDARD_CPP_NAMESPACE memmove(dst, src,
size) | 58 #define uprv_memmove(dst, src, size) U_STANDARD_CPP_NAMESPACE memmove(dst, src,
size) |
59 | 59 |
60 #endif /* U_DEBUG */ | 60 #endif /* U_DEBUG */ |
61 | 61 |
| 62 /** |
| 63 * \def UPRV_LENGTHOF |
| 64 * Convenience macro to determine the length of a fixed array at compile-time. |
| 65 * @param array A fixed length array |
| 66 * @return The length of the array, in elements |
| 67 * @internal |
| 68 */ |
| 69 #define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) |
62 #define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer,
mark, size) | 70 #define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer,
mark, size) |
63 #define uprv_memcmp(buffer1, buffer2, size) U_STANDARD_CPP_NAMESPACE memcmp(buff
er1, buffer2,size) | 71 #define uprv_memcmp(buffer1, buffer2, size) U_STANDARD_CPP_NAMESPACE memcmp(buff
er1, buffer2,size) |
64 | 72 |
65 U_CAPI void * U_EXPORT2 | 73 U_CAPI void * U_EXPORT2 |
66 uprv_malloc(size_t s) U_MALLOC_ATTR U_ALLOC_SIZE_ATTR(1); | 74 uprv_malloc(size_t s) U_MALLOC_ATTR U_ALLOC_SIZE_ATTR(1); |
67 | 75 |
68 U_CAPI void * U_EXPORT2 | 76 U_CAPI void * U_EXPORT2 |
69 uprv_realloc(void *mem, size_t size) U_ALLOC_SIZE_ATTR(2); | 77 uprv_realloc(void *mem, size_t size) U_ALLOC_SIZE_ATTR(2); |
70 | 78 |
71 U_CAPI void U_EXPORT2 | 79 U_CAPI void U_EXPORT2 |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 ptr=&stackHeader; | 598 ptr=&stackHeader; |
591 capacity=stackCapacity; | 599 capacity=stackCapacity; |
592 needToRelease=FALSE; | 600 needToRelease=FALSE; |
593 return p; | 601 return p; |
594 } | 602 } |
595 | 603 |
596 U_NAMESPACE_END | 604 U_NAMESPACE_END |
597 | 605 |
598 #endif /* __cplusplus */ | 606 #endif /* __cplusplus */ |
599 #endif /* CMEMORY_H */ | 607 #endif /* CMEMORY_H */ |
OLD | NEW |