summaryrefslogtreecommitdiffstats
path: root/Src/mem.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-20 09:01:43 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-20 09:01:43 +0000
commitaaf6682903d1a5cdb7a4c683f83c81a7af417d72 (patch)
tree0deb9c7a9e94f2c0dced62c466cc5655a51c2072 /Src/mem.c
parentzsh-workers/9381 (diff)
downloadzsh-aaf6682903d1a5cdb7a4c683f83c81a7af417d72.tar
zsh-aaf6682903d1a5cdb7a4c683f83c81a7af417d72.tar.gz
zsh-aaf6682903d1a5cdb7a4c683f83c81a7af417d72.tar.bz2
zsh-aaf6682903d1a5cdb7a4c683f83c81a7af417d72.tar.lz
zsh-aaf6682903d1a5cdb7a4c683f83c81a7af417d72.tar.xz
zsh-aaf6682903d1a5cdb7a4c683f83c81a7af417d72.tar.zst
zsh-aaf6682903d1a5cdb7a4c683f83c81a7af417d72.zip
zsh-workers/9382
Diffstat (limited to 'Src/mem.c')
-rw-r--r--Src/mem.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/Src/mem.c b/Src/mem.c
index 8dccfdbb8..4936a5e73 100644
--- a/Src/mem.c
+++ b/Src/mem.c
@@ -56,17 +56,11 @@
attempting to free this memory may result in a core dump.
The pair of pointers ncalloc and alloc may point to either
zalloc & zcalloc or zhalloc & hcalloc; permalloc() sets them to the
- former, and heapalloc() sets them to the latter. This can be useful.
- For example, the dupstruct() routine duplicates a syntax tree,
- allocating the new memory for the tree using alloc(). If you want
- to duplicate a structure for a one-time use (i.e. to execute the list
- in a for loop), call heapalloc(), then dupstruct(). If you want
- to duplicate a structure in order to preserve it (i.e. a function
- definition), call permalloc(), then dupstruct().
+ former, and heapalloc() sets them to the latter.
If possible, the heaps are allocated using mmap() so that the
(*real*) heap isn't filled up with empty zsh heaps. If mmap()
- is not available and zsh's own allocator we use a simple trick
+ is not available and zsh's own allocator is used, we use a simple trick
to avoid that: we allocate a large block of memory before allocating
a heap pool, this memory is freed again immediately after the pool
is allocated. If there are only small blocks on the free list this