Skip to content
  • Carl Worth's avatar
    glsl: Add blob.c---a simple interface for serializing data · 1c987732
    Carl Worth authored
    
    
    This new interface allows for writing a series of objects to a chunk
    of memory (a "blob").. The allocated memory is maintained within the
    blob itself, (and re-allocated by doubling when necessary).
    
    There are also functions for reading objects from a blob as well. If
    code attempts to read beyond the available memory, the read functions
    return 0 values (or its moral equivalent) without reading past the
    allocated memory. Once the caller is done with the reads, it can check
    blob->overrun to ensure whether any invalid values were previously
    returned due to attempts to read too far.
    
    Reviewed-by: default avatarJason Ekstrand <jason.ekstrand@intel.com>
    1c987732