other-licenses/android/memcluster.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /*	$NetBSD: memcluster.h,v 1.1.1.1 2004/05/20 19:49:41 christos Exp $	*/
     3 /*
     4  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
     5  * Copyright (c) 1997,1999 by Internet Software Consortium.
     6  *
     7  * Permission to use, copy, modify, and distribute this software for any
     8  * purpose with or without fee is hereby granted, provided that the above
     9  * copyright notice and this permission notice appear in all copies.
    10  *
    11  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
    12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    13  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
    14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
    17  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
    18  */
    20 /*
    21  * This version of this file is derived from Android 2.3 "Gingerbread",
    22  * which contains uncredited changes by Android/Google developers.  It has
    23  * been modified in 2011 for use in the Android build of Mozilla Firefox by
    24  * Mozilla contributors (including Michael Edwards <m.k.edwards@gmail.com>,
    25  * and Steve Workman <sjhworkman@gmail.com>).
    26  * These changes are offered under the same license as the original NetBSD
    27  * file, whose copyright and license are unchanged above.
    28  */
    30 #ifndef MEMCLUSTER_H
    31 #define MEMCLUSTER_H
    33 #include <stdio.h>
    35 #define meminit		__meminit
    36 #ifdef MEMCLUSTER_DEBUG
    37 #define memget(s)	__memget_debug(s, __FILE__, __LINE__)
    38 #define memput(p, s)	__memput_debug(p, s, __FILE__, __LINE__)
    39 #else /*MEMCLUSTER_DEBUG*/
    40 #ifdef MEMCLUSTER_RECORD
    41 #define memget(s)	__memget_record(s, __FILE__, __LINE__)
    42 #define memput(p, s)	__memput_record(p, s, __FILE__, __LINE__)
    43 #else /*MEMCLUSTER_RECORD*/
    44 #define memget		__memget
    45 #define memput		__memput
    46 #endif /*MEMCLUSTER_RECORD*/
    47 #endif /*MEMCLUSTER_DEBUG*/
    48 #define memstats	__memstats
    49 #define memactive	__memactive
    51 int	meminit(size_t, size_t);
    52 void *	__memget(size_t);
    53 void 	__memput(void *, size_t);
    54 void *	__memget_debug(size_t, const char *, int);
    55 void 	__memput_debug(void *, size_t, const char *, int);
    56 void *	__memget_record(size_t, const char *, int);
    57 void 	__memput_record(void *, size_t, const char *, int);
    58 void 	memstats(FILE *);
    59 int	memactive(void);
    61 #endif /* MEMCLUSTER_H */

mercurial