Lines Matching refs:bytes
142 _dbus_verbose ("Will fail mallocs over %ld bytes\n",
356 _dbus_verbose ("Checking %d bytes request from source %s\n",
366 _dbus_warn ("Block of %lu bytes from %s had start guard value 0x%ux at %d expected 0x%x\n",
381 _dbus_warn ("Block of %lu bytes from %s had end guard value 0x%ux at %d expected 0x%x\n",
390 /* set memory to anything but nul bytes */
448 * Allocates the given number of bytes, as with standard
449 * malloc(). Guaranteed to return #NULL if bytes is zero
456 * @param bytes number of bytes to allocate
460 dbus_malloc (size_t bytes)
467 _dbus_verbose (" FAILING malloc of %ld bytes\n", (long) bytes);
472 if (bytes == 0) /* some system mallocs handle this, some don't */
475 else if (fail_size != 0 && bytes > fail_size)
481 block = malloc (bytes + GUARD_EXTRA_SIZE);
489 (long) bytes, (long) GUARD_EXTRA_SIZE);
493 return set_guards (block, bytes, SOURCE_MALLOC);
499 mem = malloc (bytes);
508 _dbus_warn ("out of memory: malloc (%ld)\n", (long) bytes);
518 * Allocates the given number of bytes, as with standard malloc(), but
519 * all bytes are initialized to zero as with calloc(). Guaranteed to
520 * return #NULL if bytes is zero on all platforms. Returns #NULL if the
526 * @param bytes number of bytes to allocate
530 dbus_malloc0 (size_t bytes)
537 _dbus_verbose (" FAILING malloc0 of %ld bytes\n", (long) bytes);
543 if (bytes == 0)
546 else if (fail_size != 0 && bytes > fail_size)
552 block = calloc (bytes + GUARD_EXTRA_SIZE, 1);
561 (long) bytes, (long) GUARD_EXTRA_SIZE);
565 return set_guards (block, bytes, SOURCE_MALLOC_ZERO);
571 mem = calloc (bytes, 1);
580 _dbus_warn ("out of memory: calloc (%ld)\n", (long) bytes);
591 * dbus_malloc0(). Guaranteed to free the memory and return #NULL if bytes
596 * @param bytes new size of the memory block
601 size_t bytes)
608 _dbus_verbose (" FAILING realloc of %ld bytes\n", (long) bytes);
614 if (bytes == 0) /* guarantee this is safe */
620 else if (fail_size != 0 && bytes > fail_size)
632 bytes + GUARD_EXTRA_SIZE);
639 memory, (long) bytes, (long) GUARD_EXTRA_SIZE);
647 if (bytes >= old_bytes)
651 return set_guards (block, bytes, SOURCE_REALLOC);
657 block = malloc (bytes + GUARD_EXTRA_SIZE);
666 (long) bytes, (long) GUARD_EXTRA_SIZE);
670 return set_guards (block, bytes, SOURCE_REALLOC_NULL);
677 mem = realloc (memory, bytes);
682 _dbus_warn ("out of memory: malloc (%ld)\n", (long) bytes);