document useMalloc changes

This commit is contained in:
Jacek Sieka
2016-04-02 21:15:10 +08:00
parent 25f9330928
commit a2501321c3
2 changed files with 8 additions and 2 deletions

View File

@@ -243,7 +243,9 @@ Define Effect
``useFork`` Makes ``osproc`` use ``fork`` instead of ``posix_spawn``.
``useNimRtl`` Compile and link against ``nimrtl.dll``.
``useMalloc`` Makes Nim use C's `malloc`:idx: instead of Nim's
own memory manager. This only works with ``gc:none``.
own memory manager, ableit prefixing each allocation with
its size to support clearing memory on reallocation.
This only works with ``gc:none``.
``useRealtimeGC`` Enables support of Nim's GC for *soft* realtime
systems. See the documentation of the `gc <gc.html>`_
for further information.

View File

@@ -20,7 +20,11 @@ Changes affecting backwards compatibility
new experimental ``this`` pragma to achieve a similar effect to what the old ``using`` statement tried to achieve.
- Typeless parameters have been removed from the language since it would
clash with ``using``.
- When using ``useMalloc``, an additional header containing the size of the
allocation will be allocated, to support zeroing memory on realloc as expected
by the language. With this change, ``alloc`` and ``dealloc`` are no longer
aliases for ``malloc`` and ``free`` - use ``c_malloc`` and ``c_free`` if
you need that.
Library Additions
-----------------