Lines Matching defs:buf
61 unsigned char *buf;
222 if (heap.buf == NULL || heap.first == NULL) {
377 if (ptr == NULL || heap.buf == NULL || heap.first == NULL) {
381 if (p < heap.buf || p >= heap.buf + heap.len) {
551 void *buf;
555 buf = buffer_alloc_calloc(n, size);
559 return buf;
574 void mbedtls_memory_buffer_alloc_init(unsigned char *buf, size_t len)
588 } else if ((size_t) buf % MBEDTLS_MEMORY_ALIGN_MULTIPLE) {
589 /* Adjust len first since buf is used in the computation */
591 - (size_t) buf % MBEDTLS_MEMORY_ALIGN_MULTIPLE;
592 buf += MBEDTLS_MEMORY_ALIGN_MULTIPLE
593 - (size_t) buf % MBEDTLS_MEMORY_ALIGN_MULTIPLE;
596 memset(buf, 0, len);
598 heap.buf = buf;
601 heap.first = (memory_header *) buf;
637 (void *) heap.first != (void *) heap.buf) {
656 unsigned char buf[1024];
664 mbedtls_memory_buffer_alloc_init(buf, sizeof(buf));
681 end = heap.buf + heap.len;
690 mbedtls_printf(" MBA test #2 (buf not aligned): ");
693 mbedtls_memory_buffer_alloc_init(buf + 1, sizeof(buf) - 1);
695 TEST_ASSERT(heap.buf + heap.len == end);
721 mbedtls_memory_buffer_alloc_init(buf, sizeof(buf));
723 p = mbedtls_calloc(1, sizeof(buf) - sizeof(memory_header));
730 p = mbedtls_calloc(1, sizeof(buf) - 2 * sizeof(memory_header) - 16);