newsize = offset + 1;
newsize += 10;
- if (map->bitmap == NULL)
- map->bitmap = pg_malloc(newsize);
- else
- map->bitmap = pg_realloc(map->bitmap, newsize);
+ map->bitmap = pg_realloc(map->bitmap, newsize);
/* zero out the newly allocated region */
memset(&map->bitmap[oldsize], 0, newsize - oldsize);
file_entry_t *entry,
*next;
- if (filemap->array == NULL)
- filemap->array = pg_malloc(filemap->nlist * sizeof(file_entry_t));
- else
- filemap->array = pg_realloc(filemap->array,
- (filemap->nlist + filemap->narray) * sizeof(file_entry_t));
+ filemap->array =
+ pg_realloc(filemap->array,
+ (filemap->nlist + filemap->narray) * sizeof(file_entry_t));
narray = filemap->narray;
for (entry = filemap->first; entry != NULL; entry = next)
lasttli = tli;
nlines++;
- if (entries)
- entries = pg_realloc(entries, nlines * sizeof(TimeLineHistoryEntry));
- else
- entries = pg_malloc(1 * sizeof(TimeLineHistoryEntry));
+ entries = pg_realloc(entries, nlines * sizeof(TimeLineHistoryEntry));
entry = &entries[nlines - 1];
entry->tli = tli;