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.

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

mercurial