Docs fix in memory management section
This commit is contained in:
@@ -2344,8 +2344,11 @@ based on C++'s ``new`` and ``delete`` operators:
|
|||||||
In the above code, each program instance allocates its own ``count`` sized
|
In the above code, each program instance allocates its own ``count`` sized
|
||||||
array of ``uniform int`` values, uses that memory, and then deallocates
|
array of ``uniform int`` values, uses that memory, and then deallocates
|
||||||
that memory. Uses of ``new`` and ``delete`` in ``ispc`` programs are
|
that memory. Uses of ``new`` and ``delete`` in ``ispc`` programs are
|
||||||
serviced by corresponding calls the system C library's ``malloc()`` and
|
implemented as calls to C library's aligned memory allocation routines,
|
||||||
``free()`` functions.
|
which are platform dependent (``posix_memalign()`` and ``free()`` on Linux
|
||||||
|
and Mac and ``_aligned_malloc()`` and ``_aligned_free()`` on Windows). So it's
|
||||||
|
advised to pair ISPC's ``new`` and ``delete`` with each other, but not with
|
||||||
|
C/C++ memory management functions.
|
||||||
|
|
||||||
Note that the rules for ``uniform`` and ``varying`` for ``new`` are
|
Note that the rules for ``uniform`` and ``varying`` for ``new`` are
|
||||||
analogous to the corresponding rules for pointers (as described in
|
analogous to the corresponding rules for pointers (as described in
|
||||||
|
|||||||
Reference in New Issue
Block a user