Ffi: add fixed size type like int8_t or _Float16

Hello,

I’m currently trying to implement an array library using the concept of strides like numpy.
The basic idea of a strided array is to have a 1d buffer storing all the array elements and use views with a shape and stride to iterate the 1d buffer.

I would like to use the c_alloc/2 predicate from the library ffi to allocate the 1d buffer for my arrays since it provides the code to make garbage collected blobs.
But I would also like to use fixed sized integer and floating type, i.e. those defined in stdint.h like int8_t and uint8_t of all sizes and also the non standard fixed size floating type like _Float16.

I started to look at ffi/c/cmemory.c at 39f34302ca9f0c8ef786241f216d93a965734455 · JanWielemaker/ffi · GitHub and it seems that supporting these additional type is going to be quite hard/verbose.

@jan Would a pull-request be accepted if I add these types myself ?
Or should I just reimplement c_alloc myself ?

Never mind, I have just implemented a foreign interface with a blob that holds N bytes.
I think it is going to be enough for now.

If that is all you need, that is probably simpler than using the ffi module :slight_smile: