-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

        Hi list, hi Fefe,

I was reading the following slides from Fefe:
http://www.fefe.de/dietlibc/diet.pdf
about "How to write small and fast software". He mentions that using
alloca() is a good substitute to malloc() for temporary storage.

I did not even really know myself what alloca() does but its manual
definition looks interesting and practical (from NetBSD):

 The alloca() function allocates size bytes of space in the stack frame
 of the caller.  This temporary space is automatically freed on return.

until you read just a little further (again from NetBSD):

 The alloca() function is machine dependent; its use is discouraged.
 The alloca() function is slightly unsafe because it cannot ensure that
 the pointer returned points to a valid and usable block of memory.  The
 allocation made may exceed the bounds of the stack, or even go further
 into other objects in memory, and alloca() cannot determine such an
 error.  Avoid alloca() with large unbounded allocations.

so... wtf? For or against alloca(), I would be interested in your take
about this.

@Fefe: not sure if you read Darklab, cc'd you in case.

Cheers,
- --
khorben
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (NetBSD)

iD8DBQFFSPYfF/6l+XqPVO4RAuk5AKCUOhdF46p8TWGijw3E0NwO9PjdywCgkgTG
K3u7ZJhwCC5gzcXq3q9IfDo=
=yVXs
-----END PGP SIGNATURE-----
_______________________________________________
darklab mailing list
[email protected]
http://lists.darklab.org/cgi-bin/mailman/listinfo/darklab

Reply via email to