070d3dedf7
VM internals. This PRNG is not used to generate random numbers in Dart code. - Use the PRNG to generate JIT cookies for large constants if needed during assembly. - Add the possibility to set an external entropy source for the PRNG through the C API. R=asiva@google.com Review URL: https://codereview.chromium.org//59773007 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29950 260f80e4-7a28-3924-810f-c04153c831b5
32 lines
589 B
C++
32 lines
589 B
C++
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef VM_RANDOM_H_
|
|
#define VM_RANDOM_H_
|
|
|
|
#include "vm/globals.h"
|
|
#include "vm/allocation.h"
|
|
|
|
namespace dart {
|
|
|
|
class Random : public ValueObject {
|
|
public:
|
|
Random();
|
|
~Random();
|
|
|
|
uint32_t NextUInt32();
|
|
|
|
private:
|
|
void NextState();
|
|
|
|
uint64_t _state;
|
|
|
|
DISALLOW_ALLOCATION();
|
|
DISALLOW_COPY_AND_ASSIGN(Random);
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // VM_RANDOM_H_
|