Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 436a0a5 in mainline for kernel/generic/src/lib/str.c


Ignore:
Timestamp:
2018-11-09T22:04:01Z (3 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master
Children:
95d45482
Parents:
88e43bc (diff), abf6c01 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

(merge) Reduce the number of blocking allocations in the kernel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/lib/str.c

    r88e43bc r436a0a5  
    635635{
    636636        size_t size = str_size(src) + 1;
    637         char *dest = nfmalloc(size);
    638         assert(dest);
     637        char *dest = malloc(size);
     638        if (!dest)
     639                return NULL;
    639640
    640641        str_cpy(dest, size, src);
     
    668669                size = n;
    669670
    670         char *dest = nfmalloc(size + 1);
    671         assert(dest);
     671        char *dest = malloc(size + 1);
     672        if (!dest)
     673                return NULL;
    672674
    673675        str_ncpy(dest, size + 1, src, size);
Note: See TracChangeset for help on using the changeset viewer.