mojoshader_common.c
changeset 1113 570cae807859
parent 1111 7530b37979b8
child 1116 0ef3d106dab9
equal deleted inserted replaced
1112:ef76d5efedcc 1113:570cae807859
   725         } // if
   725         } // if
   726     } // if
   726     } // if
   727 
   727 
   728     if (len > 0)
   728     if (len > 0)
   729     {
   729     {
   730         assert((!buffer->tail) || (buffer->tail->bytes == blocksize));
   730         assert((!buffer->tail) || (buffer->tail->bytes >= blocksize));
   731         const size_t bytecount = len > blocksize ? len : blocksize;
   731         const size_t bytecount = len > blocksize ? len : blocksize;
   732         const size_t malloc_len = sizeof (BufferBlock) + bytecount;
   732         const size_t malloc_len = sizeof (BufferBlock) + bytecount;
   733         BufferBlock *item = (BufferBlock *) buffer->m(malloc_len, buffer->d);
   733         BufferBlock *item = (BufferBlock *) buffer->m(malloc_len, buffer->d);
   734         if (item == NULL)
   734         if (item == NULL)
   735             return 0;
   735             return 0;