[ODE] autoconf/automake
Russ Smith
russ at q12.org
Sun Nov 18 21:47:02 MST 2001
jens,
in the interests of not having to configure for the mmap() based
stack implementation, i've been thinking about an alternative scheme.
i just did an experiment with linux malloc() - if you allocate a large
chunk, pages are actually allocated to the address space as you write
to them, not on the malloc. this is true for both the anon-mmap() and
sbrk() implementations of malloc. so on linux at least, and probably
most *nix platforms, malloc can be used in the stack code.
i have not done this experiment on window yet.
so a portable stack implementation could work something like this:
1. if the platform supports allocate-on-write memory pages, use a
simple malloc()-based stack implementation that allocates a single
large chunk (e.g. 1Mb) for each stack.
2. otherwise, use an arena based implementation that uses malloc to
allocate a multiple chunks of a smaller fixed size (say 4k), which
are linked together similar to GNU obstacks.
in fact ... we could just implement option 2 on all platforms and be
done with it. the performance hit will be very small and the savings in
complexity (for the configurator) will be worth it. so ... hmmm ...
i think i'll go with option 2 unless anybody has any better ideas.
the size parameter to dJointGroupCreate() will be deprecated.
the point of this email is: don't waste any of your time thinking about
mmap() with autoconf.
cheers,
russ.
--
Russell Smith
http://www.q12.org
More information about the ODE
mailing list