Home | History | Annotate | Download | only in dbus

Lines Matching full:bytes

141           _dbus_verbose ("Will fail mallocs over %ld bytes\n",
348 _dbus_verbose ("Checking %d bytes request from source %s\n",
358 _dbus_warn ("Block of %lu bytes from %s had start guard value 0x%ux at %d expected 0x%x\n",
373 _dbus_warn ("Block of %lu bytes from %s had end guard value 0x%ux at %d expected 0x%x\n",
382 /* set memory to anything but nul bytes */
440 * Allocates the given number of bytes, as with standard
441 * malloc(). Guaranteed to return #NULL if bytes is zero
448 * @param bytes number of bytes to allocate
452 dbus_malloc (size_t bytes)
459 _dbus_verbose (" FAILING malloc of %ld bytes\n", (long) bytes);
464 if (bytes == 0) /* some system mallocs handle this, some don't */
467 else if (fail_size != 0 && bytes > fail_size)
473 block = malloc (bytes + GUARD_EXTRA_SIZE);
477 return set_guards (block, bytes, SOURCE_MALLOC);
483 mem = malloc (bytes);
493 * Allocates the given number of bytes, as with standard malloc(), but
494 * all bytes are initialized to zero as with calloc(). Guaranteed to
495 * return #NULL if bytes is zero on all platforms. Returns #NULL if the
501 * @param bytes number of bytes to allocate
505 dbus_malloc0 (size_t bytes)
512 _dbus_verbose (" FAILING malloc0 of %ld bytes\n", (long) bytes);
518 if (bytes == 0)
521 else if (fail_size != 0 && bytes > fail_size)
527 block = calloc (bytes + GUARD_EXTRA_SIZE, 1);
530 return set_guards (block, bytes, SOURCE_MALLOC_ZERO);
536 mem = calloc (bytes, 1);
547 * dbus_malloc0(). Guaranteed to free the memory and return #NULL if bytes
552 * @param bytes new size of the memory block
557 size_t bytes)
564 _dbus_verbose (" FAILING realloc of %ld bytes\n", (long) bytes);
570 if (bytes == 0) /* guarantee this is safe */
576 else if (fail_size != 0 && bytes > fail_size)
588 bytes + GUARD_EXTRA_SIZE);
591 if (block && bytes >= old_bytes)
595 return set_guards (block, bytes, SOURCE_REALLOC);
601 block = malloc (bytes + GUARD_EXTRA_SIZE);
606 return set_guards (block, bytes, SOURCE_REALLOC_NULL);
613 mem = realloc (memory, bytes);