Skip to content

Minor nit; type mismatch in zone_batch_malloc(), OSX #1149

@bazineta

Description

@bazineta

Pedantic compiler warning on an integral type mismatch in zone_batch_malloc() in the OSX primitive:

static unsigned zone_batch_malloc(malloc_zone_t* zone, size_t size, void** ps, unsigned count) {

static unsigned zone_batch_malloc(malloc_zone_t* zone, size_t size, void** ps, unsigned count) {
  size_t i;
  for (i = 0; i < count; i++) {
    ps[i] = zone_malloc(zone, size);
    if (ps[i] == NULL) break;
  }
  return i;
}

count is an unsigned, while i is a size_t. Since this is part of Apple's malloc zone hooks, we're stuck with the interface declaration, so making i an unsigned silences the warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions