mirror of
https://github.com/golang/go
synced 2024-11-26 04:17:59 -07:00
75647d2024
R=r DELTA=756 (754 added, 0 deleted, 2 changed) OCL=19266 CL=19378
33 lines
647 B
C
33 lines
647 B
C
// Copyright 2009 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
#include "../../../src/runtime/runtime.h"
|
|
|
|
typedef struct PageMap PageMap;
|
|
|
|
enum
|
|
{
|
|
PageShift = 12,
|
|
PageMask = (1<<PageShift) - 1,
|
|
};
|
|
|
|
enum {
|
|
PMBits = 64 - PageShift,
|
|
PMLevels = 4,
|
|
PMLevelBits = 13,
|
|
PMLevelSize = 1<<PMLevelBits,
|
|
PMLevelMask = PMLevelSize - 1,
|
|
};
|
|
struct PageMap
|
|
{
|
|
void *level0[PMLevelSize];
|
|
};
|
|
|
|
extern int64 allocator·footprint;
|
|
extern bool allocator·frozen;
|
|
|
|
void* trivalloc(int32);
|
|
void* pmlookup(PageMap*, uintptr);
|
|
void* pminsert(PageMap*, uintptr, void*);
|