From b9d68914e6148bf9334f45188c871f161489e3d6 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 16 Apr 2021 11:33:47 -0400 Subject: [PATCH] TT#111150 remove obsolete str_chunk_insert This leads to unaligned memory access, so remove it. Change-Id: I4d7c6d42a58f20a0d69fbb933cb925e3bcf0c695 --- lib/str.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/str.h b/lib/str.h index 4af03bf50..260f96514 100644 --- a/lib/str.h +++ b/lib/str.h @@ -68,8 +68,6 @@ INLINE void str_free_dup(str *out); INLINE str *str_alloc(int len); /* returns new str object allocated with malloc, including buffer */ INLINE str *str_dup(const str *s); -/* returns new str object allocated from chunk, including buffer */ -INLINE str *str_chunk_insert(GStringChunk *c, const str *s); /* shifts pointer by len chars and decrements len. returns -1 if buffer too short, 0 otherwise */ INLINE int str_shift(str *s, int len); /* eats the supplied string from the beginning of s. returns -1 if string head doesn't match */ @@ -123,12 +121,6 @@ str *str_uri_decode_len(const char *in, int in_len); -INLINE str *str_chunk_insert(GStringChunk *c, const str *s) { - str *i; - i = (void *) g_string_chunk_insert_len(c, (void *) s, sizeof(*s)); - i->s = g_string_chunk_insert_len(c, s->s, s->len); - return i; -} INLINE char *str_end(const str *s) { return s->s + s->len; }