js/src/gc/Memory.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  * vim: set ts=8 sts=4 et sw=4 tw=99:
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef gc_Memory_h
     8 #define gc_Memory_h
    10 #include <stddef.h>
    12 struct JSRuntime;
    14 namespace js {
    15 namespace gc {
    17 // Sanity check that our compiled configuration matches the currently running
    18 // instance and initialize any runtime data needed for allocation.
    19 void
    20 InitMemorySubsystem(JSRuntime *rt);
    22 // Allocate or deallocate pages from the system with the given alignment.
    23 void *
    24 MapAlignedPages(JSRuntime *rt, size_t size, size_t alignment);
    26 void
    27 UnmapPages(JSRuntime *rt, void *p, size_t size);
    29 // Tell the OS that the given pages are not in use, so they should not
    30 // be written to a paging file. This may be a no-op on some platforms.
    31 bool
    32 MarkPagesUnused(JSRuntime *rt, void *p, size_t size);
    34 // Undo |MarkPagesUnused|: tell the OS that the given pages are of interest
    35 // and should be paged in and out normally. This may be a no-op on some
    36 // platforms.
    37 bool
    38 MarkPagesInUse(JSRuntime *rt, void *p, size_t size);
    40 // Returns #(hard faults) + #(soft faults)
    41 size_t
    42 GetPageFaultCount();
    44 // Allocate memory mapped content.
    45 // The offset must be aligned according to alignment requirement.
    46 void *
    47 AllocateMappedContent(int fd, size_t offset, size_t length, size_t alignment);
    49 // Deallocate memory mapped content.
    50 void
    51 DeallocateMappedContent(void *p, size_t length);
    53 } // namespace gc
    54 } // namespace js
    56 #endif /* gc_Memory_h */

mercurial