]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
memory-util: drop unused memdup_reverse()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 30 Jun 2026 16:55:39 +0000 (01:55 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 2 Jul 2026 18:02:56 +0000 (03:02 +0900)
With the previous commit, now the function is unused anymore.
Let's drop it.

src/basic/memory-util.c
src/basic/memory-util.h

index f03ed7adbbe26791ed2883a2d71419679eb86050..10a5157ca64666934769ffea67ccfba54ecb508e 100644 (file)
@@ -19,22 +19,6 @@ size_t page_size(void) {
         return pgsz;
 }
 
-void* memdup_reverse(const void *mem, size_t size) {
-        assert(mem);
-        assert(size != 0);
-
-        void *p = malloc(size);
-        if (!p)
-                return NULL;
-
-        uint8_t *p_dst = p;
-        const uint8_t *p_src = mem;
-        for (size_t i = 0, k = size; i < size; i++, k--)
-                p_dst[i] = p_src[k-1];
-
-        return p;
-}
-
 void* erase_and_free(void *p) {
         size_t l;
 
index 4caf58585a77924ed34dd2c387c87624d6f428ab..39dff8271a217efd7cd40cf515b5bb5506e4b50f 100644 (file)
@@ -98,6 +98,3 @@ static inline void erase_and_freep(void *p) {
 static inline void erase_char(char *p) {
         explicit_bzero_safe(p, sizeof(char));
 }
-
-/* Makes a copy of the buffer with reversed order of bytes */
-void* memdup_reverse(const void *mem, size_t size);