Ticket #29157: zzuf.memory-fix.patch

File zzuf.memory-fix.patch, 2.1 KB (added by l2g@…, 13 years ago)

Patch to fix a memory bug related to OS X (from http://caca.zoy.org/changeset/4314/zzuf/trunk)

  • dports/security/zzuf/Portfile

    old new  
    44
    55name              zzuf
    66version           0.13
    7 revision          1
     7revision          2
    88categories        security
    99platforms         darwin
    1010maintainers       pmq
     
    2424checksums         sha1 19f904d63d045194885639c381a607ca86a319b5 \
    2525              rmd160 ef9988a6d97f213090227a0b6d87e4d942ed8c15
    2626
     27patchfiles      patch-src-libzzuf-lib--mem.c.diff
     28patch.pre_args  -p3
     29
    2730# zzcat conflicts with libzzip; zzuff upstream has renamed it
    2831# to 'zzat', but a new release is not yet available.
    2932# See also: http://caca.zoy.org/ticket/86
  • new file macports/dports/security/zzuf/files/patch-src-libzzuf-lib--mem.c.diff

    - +  
     1Index: zzuf/trunk/src/libzzuf/lib-mem.c
     2===================================================================
     3--- a/zzuf/trunk/src/libzzuf/lib-mem.c
     4+++ b/zzuf/trunk/src/libzzuf/lib-mem.c
     5@@ -132,8 +132,4 @@
     6 /* setrlimit(RLIMIT_AS) is ignored on OS X, we need to check memory usage
     7  * from inside the process. Oh, and getrusage() doesn't work either. */
     8-#if defined HAVE_MACH_TASK_H
     9-vm_size_t mach_page_size;
     10-#endif
     11-
     12 static int memory_exceeded(void)
     13 {
     14@@ -144,6 +140,5 @@
     15     if (task_info(mach_task_self(), TASK_BASIC_INFO,
     16                   (task_info_t)&tbi, &mmtn) == KERN_SUCCESS
     17-         && (int64_t)tbi.resident_size * mach_page_size / 1048576
     18-                  > (int64_t)_zz_memory)
     19+         && (int64_t)tbi.resident_size / 1048576 > (int64_t)_zz_memory)
     20         return 1;
     21 #endif
     22@@ -157,8 +152,4 @@
     23     LOADSYM(malloc);
     24     LOADSYM(realloc);
     25-
     26-#if defined HAVE_MACH_TASK_H
     27-    host_page_size(mach_host_self(), &mach_page_size);
     28-#endif
     29 }
     30 
     31 No newline at end of file