From 103ef25f12bfd736a1ca84f71358059991354c6d Mon Sep 17 00:00:00 2001 From: Dmitry Babokin Date: Sun, 27 Oct 2013 23:01:20 +0400 Subject: [PATCH] Docs fix in memory management section --- docs/ispc.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/ispc.rst b/docs/ispc.rst index eac9b24e..84063694 100644 --- a/docs/ispc.rst +++ b/docs/ispc.rst @@ -2344,8 +2344,11 @@ based on C++'s ``new`` and ``delete`` operators: In the above code, each program instance allocates its own ``count`` sized array of ``uniform int`` values, uses that memory, and then deallocates that memory. Uses of ``new`` and ``delete`` in ``ispc`` programs are -serviced by corresponding calls the system C library's ``malloc()`` and -``free()`` functions. +implemented as calls to C library's aligned memory allocation routines, +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 analogous to the corresponding rules for pointers (as described in