Skip to content
Snippets Groups Projects
  • Jonathan Schöbel's avatar
    a5019da8
    TextSegment: changed allocation semantics · a5019da8
    Jonathan Schöbel authored
    A text_segment allocates memory in terms of chunks, this is now also
    done, when created from a string, but this means that we can't rely on
    strdup anymore, as it takes care of the allocation. Calling malloc
    ourselves shouldn't be such an overhead as at least glibc's strdup
    performs the exact same steps. Actually we should be spare a strlen call
    now, so it should be more perfomant.
    a5019da8
    History
    TextSegment: changed allocation semantics
    Jonathan Schöbel authored
    A text_segment allocates memory in terms of chunks, this is now also
    done, when created from a string, but this means that we can't rely on
    strdup anymore, as it takes care of the allocation. Calling malloc
    ourselves shouldn't be such an overhead as at least glibc's strdup
    performs the exact same steps. Actually we should be spare a strlen call
    now, so it should be more perfomant.