#pragma alloc
The
#pragma alloc
library function "
An important property of these functions is that the pointer returned by
the function does not point at any other object in the context of the call.
In the example,
#pragma alloc
int *new_buf(void);
int *vmul(int *a, int *b) {
int *out = new_buf();
for (i = 0; i < N; ++i)
out[i] = a[i] * b[i];
return out;
}
the compiler can reorder the iterations of the loop because the
tells it that
alloc
The GNU attribute
#pragma pure
The
#pragma pure
any global variables, and does not read or write any volatile variables. Its
result, therefore, is a function of its parameters or of global variables. If
any of the parameters are pointers the function may read the data they
point at but it may not write it.
As this means the function call will have the same effect every time it is
called, between assignments to global variables, the compiler need not
generate the code for every call. Therefore, in this example,
#pragma pure
long sdot(short *, short *, int);
long tendots(short *a, short *b, int n) {
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
for ADSP-219x DSPs
tells the compiler that the function behaves like the
", returning a pointer to a newly allocated object.
malloc
and
cannot overlap
a
b
is also be supported with the same meaning.
malloc
tells the compiler that the function does not write to
.
out
Compiler
#pragma
1-129
Need help?
Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?
Questions and answers