/usr/include/singular/omalloc/omMemOps.h is in libsingular4-dev-common 4.0.3+ds-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | /*******************************************************************
* File: omMemOps.h
* Purpose: low-level Macros for memory operations
* Author: obachman (Olaf Bachmann)
* Created: 11/99
*******************************************************************/
#ifndef OM_MEM_OPS_H
#define OM_MEM_OPS_H
#ifdef DO_DEEP_PROFILE
extern void _omMemcpyW(long* p1, long* p2, long l);
#define omMemcpy_nwEVEN(p1, p2, l) _omMemcpyW((long*) p1, (long*) p2, (long) l)
#define omMemcpy_nwODD(p1, p2, l) _omMemcpyW((long*) p1, (long*) p2, (long) l)
#define omMemcpyW(p1, p2, l) _omMemcpyW((long*) p1, (long*) p2, (long) l)
extern void _omMemaddW(long* p1, long* p2, long* p3, long l);
#define omMemaddW(p1, p2, p3, l) _omMemaddW(p1, p2, p3, l)
#define omMemadd_nwODD(p1, p2, p3, l) _omMemaddW(p1, p2, p3, l)
#define omMemadd_nwEVEN(p1, p2, p3, l) _omMemaddW(p1, p2, p3, l)
#define omMemadd_nwONE(p1, p2, p3) _omMemaddW(p1, p2, p3, 1)
#define omMemadd_nwTWO(p1, p2, p3) _omMemaddW(p1, p2, p3, 2)
extern void _omMemsetW(long* p1, long w, long l);
#define omMemsetW(p1, w, l) _omMemsetW(p1, w, l)
#else /* ! DO_DEEP_PROFILE */
#define omMemcpyW(p1, p2, l) \
do \
{ \
long _i = l; \
long* _s1 = (long*) (p1); \
const long* _s2 = (long*) (p2); \
\
for (;;) \
{ \
*_s1 = *_s2; \
_i--; \
if (_i == 0) break; \
_s1++; \
_s2++; \
} \
} \
while(0)
#define omMemcpy_nwODD(p1, p2, l) \
do \
{ \
long _i = (l) - 1; \
long* _s1 = (long*) (p1); \
const long* _s2 = (long*) (p2); \
\
*_s1++ = *_s2++; \
for (;;) \
{ \
*_s1++ = *_s2++; \
*_s1++ = *_s2++; \
_i -= 2; \
if (_i == 0) break; \
} \
} \
while(0)
#define omMemcpy_nwEVEN(p1, p2, l) \
do \
{ \
long _i = l; \
long* _s1 = (long*) (p1); \
const long* _s2 = (long*) (p2); \
\
for (;;) \
{ \
*_s1++ = *_s2++; \
*_s1++ = *_s2++; \
_i -= 2; \
if (_i == 0) break; \
} \
} \
while(0)
#define omMemaddW(P1, P2, P3, L) \
do \
{ \
unsigned long* _p1 = P1; \
const unsigned long* _p2 = P2; \
const unsigned long* _p3 = P3; \
unsigned long l = L; \
\
do \
{ \
*_p1++ = *_p2++ + *_p3++; \
l--; \
} \
while(l); \
} \
while(0)
#define omMemadd_nwODD(P1, P2, P3, L) \
do \
{ \
unsigned long* _p1 = P1; \
const unsigned long* _p2 = P2; \
const unsigned long* _p3 = P3; \
unsigned long l = L; \
\
*_p1++ = *_p2++ + *_p3++; \
l--; \
\
do \
{ \
*_p1++ = *_p2++ + *_p3++; \
*_p1++ = *_p2++ + *_p3++; \
l -=2; \
} \
while(l); \
} \
while(0)
#define omMemadd_nwEVEN(P1, P2, P3, L) \
do \
{ \
unsigned long* _p1 = P1; \
const unsigned long* _p2 = P2; \
const unsigned long* _p3 = P3; \
unsigned long l = L; \
\
do \
{ \
*_p1++ = *_p2++ + *_p3++; \
*_p1++ = *_p2++ + *_p3++; \
l -=2; \
} \
while(l); \
} \
while(0)
#define omMemadd_nwONE(P1, P2, P3) \
do \
{ \
unsigned long* _p1 = P1; \
const unsigned long* _p2 = P2; \
const unsigned long* _p3 = P3; \
\
*_p1 = *_p2 + *_p3; \
} \
while(0)
#define omMemadd_nwTWO(P1, P2, P3) \
do \
{ \
unsigned long* _p1 = P1; \
const unsigned long* _p2 = P2; \
const unsigned long* _p3 = P3; \
\
*_p1++ = *_p2++ + *_p3++; \
*_p1 = *_p2 + *_p3; \
} \
while(0)
#define omMemsetW(P1, W, L) \
do \
{ \
long* _p1 = (long*) (P1); \
unsigned long _l = L; \
unsigned long _w = W; \
while(_l) \
{ \
*_p1++ = _w; \
_l--; \
} \
} \
while(0)
#endif /* DO_DEEP_PROFILE */
#endif /* OM_LIST_H */
|