From b0a54c0318f73e8824c1299900286d1d7dcade3a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:38:57 +0200 Subject: Adding debian version 5.2.15-2. Signed-off-by: Daniel Baumann --- debian/patches/no-brk-caching.diff | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 debian/patches/no-brk-caching.diff (limited to 'debian/patches/no-brk-caching.diff') diff --git a/debian/patches/no-brk-caching.diff b/debian/patches/no-brk-caching.diff new file mode 100644 index 0000000..dc4ba85 --- /dev/null +++ b/debian/patches/no-brk-caching.diff @@ -0,0 +1,47 @@ +# DP: Don't cache the value of brk between sbrk calls. + +--- a/lib/malloc/malloc.c ++++ b/lib/malloc/malloc.c +@@ -227,8 +227,6 @@ + static int pagebucket; /* bucket for requests a page in size */ + static int maxbuck; /* highest bucket receiving allocation request. */ + +-static char *memtop; /* top of heap */ +- + static const unsigned long binsizes[NBUCKETS] = { + 8UL, 16UL, 32UL, 64UL, 128UL, 256UL, 512UL, 1024UL, 2048UL, 4096UL, + 8192UL, 16384UL, 32768UL, 65536UL, 131072UL, 262144UL, 524288UL, +@@ -538,7 +536,6 @@ + siz = binsize (nu); + /* Should check for errors here, I guess. */ + sbrk (-siz); +- memtop -= siz; + + #ifdef MALLOC_STATS + _mstats.nsbrk++; +@@ -633,8 +630,6 @@ + if ((long)mp == -1) + goto morecore_done; + +- memtop += sbrk_amt; +- + /* shouldn't happen, but just in case -- require 8-byte alignment */ + if ((long)mp & MALIGN_MASK) + { +@@ -684,7 +679,7 @@ + Some of this partial page will be wasted space, but we'll use as + much as we can. Once we figure out how much to advance the break + pointer, go ahead and do it. */ +- memtop = curbrk = sbrk (0); ++ curbrk = sbrk (0); + sbrk_needed = pagesz - ((long)curbrk & (pagesz - 1)); /* sbrk(0) % pagesz */ + if (sbrk_needed < 0) + sbrk_needed += pagesz; +@@ -699,7 +694,6 @@ + curbrk = sbrk (sbrk_needed); + if ((long)curbrk == -1) + return -1; +- memtop += sbrk_needed; + + /* Take the memory which would otherwise be wasted and populate the most + popular bin (2 == 32 bytes) with it. Add whatever we need to curbrk -- cgit v1.2.3