C-style generic stack implementation in C#
UIntPtr is the wrong type to represent a count (it's basically a void *). You want UInt32 or UInt64 depending on your architecture.
Count should be private set; callers should not be able to change it directly
Why are elemsize and alloclength both signed ints? Shouldn't they be unsigned? Or at least check the incoming elemsize in the constructor?
I hope that the documentation explains that the FreeFunction is for freeing individual elements that the Stack owns if it gets destroyed nonempty.
What's supposed to happen when they Pop an empty stack? Right now you get undefined behavior.
What's supposed to happen if the malloc() or realloc() fails?