~ubuntu-branches/debian/jessie/arb/jessie

« back to all changes in this revision

Viewing changes to GDE/MUSCLE/src/globalsosx.cpp

  • Committer: Package Import Robot
  • Author(s): Elmar Pruesse, Andreas Tille, Elmar Pruesse
  • Date: 2014-09-02 15:15:06 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140902151506-jihq58b3iz342wif
Tags: 6.0.2-1
[ Andreas Tille ]
* New upstream version
  Closes: #741890
* debian/upstream -> debian/upstream/metadata
* debian/control:
   - Build-Depends: added libglib2.0-dev
   - Depends: added mafft, mrbayes
* debian/rules
   - Add explicite --remove-section=.comment option to manual strip call
* cme fix dpkg-control
* arb-common.dirs: Do not create unneeded lintian dir
* Add turkish debconf translation (thanks for the patch to Mert Dirik
  <mertdirik@gmail.com>)
  Closes: #757497

[ Elmar Pruesse ]
* patches removed:
   - 10_config.makefiles.patch,
     80_no_GL.patch
       removed in favor of creating file from config.makefile.template via 
       sed in debian/control
   - 20_Makefile_main.patch
       merged upstream
   - 21_Makefiles.patch
       no longer needed
   - 30_tmpfile_CVE-2008-5378.patch: 
       merged upstream
   - 50_fix_gcc-4.8.patch:
       merged upstream
   - 40_add_libGLU.patch:
       libGLU not needed for arb_ntree)
   - 60_use_debian_packaged_raxml.patch:
       merged upstream
   - 70_hardening.patch
       merged upstream
   - 72_add_math_lib_to_linker.patch
       does not appear to be needed
* patches added:
   - 10_upstream_r12793__show_db_load_progress:
       backported patch showing progress while ARB is loading a database
       (needed as indicator/splash screen while ARB is launching)
   - 20_upstream_r12794__socket_permissions:
       backported security fix
   - 30_upstream_r12814__desktop_keywords:
       backported add keywords to desktop (fixes lintian warning)
   - 40_upstream_r12815__lintian_spelling:
       backported fix for lintian reported spelling errors
   - 50_private_nameservers
       change configuration to put nameservers into users home dirs
       (avoids need for shared writeable directory)
   - 60_use_debian_phyml
       use phyml from debian package for both interfaces in ARB
* debian/rules:
   - create config.makefile from override_dh_configure target
   - use "make tarfile" in override_dh_install
   - remove extra cleaning not needed for ARB 6
   - use "dh_install --list-missing" to avoid missing files
   - added override_dh_fixperms target
* debian/control:
   - added libarb-dev package
   - Depends: added phyml, xdg-utils
   - Suggests: removed phyml
   - fix lintian duplicate-short-description (new descriptions)
* debian/*.install:
   - "unrolled" confusing globbing to select files
   - pick files from debian/tmp
   - moved all config files to /etc/arb
* debian/arb-common.templates: updated
* scripts:
   - removed arb-add-pt-server
   - launch-wrapper: 
     - only add demo.arb to newly created $ARBUSERDATA
     - pass commandline arguments through bin/arb wrapper
   - preinst: removing old PT server index files on upgrade from 5.5*
   - postinst: set setgid on shared PT dir
* rewrote arb.1 manfile
* added file icon for ARB databases
* using upstream arb_tcp.dat

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifdef __MACH__
 
2
 
 
3
#include <memory.h>
 
4
#include <stdlib.h>
 
5
#include <stdio.h>
 
6
#include <unistd.h>
 
7
#include <sys/types.h>
 
8
#include <sys/sysctl.h>
 
9
#include <sys/socket.h>
 
10
#include <sys/gmon.h>
 
11
#include <mach/vm_param.h>
 
12
#include <netinet/in.h>
 
13
#include <netinet/icmp6.h>
 
14
#include <sys/vmmeter.h>
 
15
#include <sys/proc.h>
 
16
#include <mach/task_info.h>
 
17
#include <mach/task.h>
 
18
#include <mach/mach_init.h>
 
19
#include <mach/vm_statistics.h>
 
20
 
 
21
const double DEFAULT_RAM = 1e9;
 
22
const double DEFAULT_MEM_USE = 1e6;
 
23
 
 
24
double GetNAN()
 
25
        {
 
26
        static unsigned long nan[2]={0xffffffff, 0x7fffffff};
 
27
        double dNAN = *( double* )nan;
 
28
        return dNAN;
 
29
        }
 
30
 
 
31
double g_dNAN = GetNAN();
 
32
 
 
33
 
 
34
double GetRAMSize()
 
35
        {
 
36
        static double CACHED_RAM = 0;
 
37
        if (CACHED_RAM != 0)
 
38
                return CACHED_RAM;
 
39
 
 
40
        uint64_t MemPages = 0;
 
41
        size_t Len = sizeof(MemPages);
 
42
        if (sysctlbyname("hw.memsize", &MemPages, &Len, NULL, 0) < 0)
 
43
                return DEFAULT_RAM;
 
44
        return (double) MemPages;
 
45
        }
 
46
 
 
47
double GetRAMSizeMB()
 
48
        {
 
49
        return GetRAMSize()/1e6;
 
50
        }
 
51
 
 
52
static double g_uPeakMemUseBytes;
 
53
 
 
54
double GetMaxMemUseBytes()
 
55
        {
 
56
        return g_uPeakMemUseBytes;
 
57
        }
 
58
 
 
59
double GetPeakMemUseBytes()
 
60
        {
 
61
        return GetMaxMemUseBytes();
 
62
        }
 
63
 
 
64
double GetMemUseBytes()
 
65
        {
 
66
        task_t mytask = mach_task_self();
 
67
        struct task_basic_info ti;
 
68
        memset((void *) &ti, 0, sizeof(ti));
 
69
        mach_msg_type_number_t count = TASK_BASIC_INFO_COUNT;
 
70
        kern_return_t ok = task_info(mytask, TASK_BASIC_INFO, (task_info_t) &ti, &count);
 
71
        if (ok == KERN_INVALID_ARGUMENT)
 
72
                return DEFAULT_MEM_USE;
 
73
 
 
74
        if (ok != KERN_SUCCESS)
 
75
                return DEFAULT_MEM_USE;
 
76
 
 
77
        double uBytes = (double ) ti.resident_size;
 
78
        if (uBytes > g_uPeakMemUseBytes)
 
79
                g_uPeakMemUseBytes = uBytes;
 
80
        return uBytes;
 
81
        }
 
82
 
 
83
double GetMemUseMB()
 
84
        {
 
85
        return GetMemUseBytes()/1e6;
 
86
        }
 
87
 
 
88
void OSInit()
 
89
        {
 
90
        }
 
91
 
 
92
#endif // __MACH__