src/SDL_dataqueue.h
changeset 10743 8ccdeceaae6d
parent 10737 3406a0f8b041
child 11582 cc0b1273a381
     1.1 --- a/src/SDL_dataqueue.h	Mon Jan 02 10:30:32 2017 -0800
     1.2 +++ b/src/SDL_dataqueue.h	Tue Dec 27 23:48:43 2016 -0500
     1.3 @@ -33,6 +33,21 @@
     1.4  size_t SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *buf, const size_t len);
     1.5  size_t SDL_CountDataQueue(SDL_DataQueue *queue);
     1.6  
     1.7 +/* this sets a section of the data queue aside (possibly allocating memory for it)
     1.8 +   as if it's been written to, but returns a pointer to that space. You may write
     1.9 +   to this space until a read would consume it. Writes (and other calls to this
    1.10 +   function) will safely append their data after this reserved space and can
    1.11 +   be in flight at the same time. There is no thread safety.
    1.12 +   If there isn't an existing block of memory that can contain the reserved
    1.13 +   space, one will be allocated for it. You can not (currently) allocate
    1.14 +   a space larger than the packetlen requested in SDL_NewDataQueue.
    1.15 +   Returned buffer is uninitialized.
    1.16 +   This lets you avoid an extra copy in some cases, but it's safer to use
    1.17 +   SDL_WriteToDataQueue() unless you know what you're doing.
    1.18 +   Returns pointer to buffer of at least (len) bytes, NULL on error.
    1.19 +*/
    1.20 +void *SDL_ReserveSpaceInDataQueue(SDL_DataQueue *queue, const size_t len);
    1.21 +
    1.22  #endif /* SDL_dataqueue_h_ */
    1.23  
    1.24  /* vi: set ts=4 sw=4 expandtab: */