Skip to content

Commit

Permalink
Add some missing allocation constraints.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmacnak committed Nov 9, 2024
1 parent 9ca23b6 commit ea97030
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 5 deletions.
1 change: 0 additions & 1 deletion vm/allocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#ifndef VM_ALLOCATION_H_
#define VM_ALLOCATION_H_

#include "vm/assert.h"
#include "vm/globals.h"

namespace psoup {
Expand Down
3 changes: 2 additions & 1 deletion vm/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#ifndef VM_HEAP_H_
#define VM_HEAP_H_

#include "vm/allocation.h"
#include "vm/assert.h"
#include "vm/flags.h"
#include "vm/globals.h"
Expand Down Expand Up @@ -439,7 +440,7 @@ class Heap {
DISALLOW_COPY_AND_ASSIGN(Heap);
};

class HandleScope {
class HandleScope : public ValueObject {
public:
HandleScope(Heap* heap, Object* ptr) : heap_(heap) {
ASSERT(heap_->handles_size_ < Heap::kHandlesCapacity);
Expand Down
3 changes: 3 additions & 0 deletions vm/io_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#ifndef VM_IO_BUFFER_H_
#define VM_IO_BUFFER_H_

#include "vm/assert.h"
#include "vm/globals.h"

namespace psoup {

enum Operation {
Expand Down
3 changes: 2 additions & 1 deletion vm/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
#include <limits>
#include <type_traits>

#include "vm/allocation.h"
#include "vm/assert.h"
#include "vm/globals.h"

namespace psoup {

class Math {
class Math : public AllStatic {
public:
template <typename T>
static inline bool AddHasOverflow(T left, T right, T* result) {
Expand Down
1 change: 1 addition & 0 deletions vm/message_loop_fuchsia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <zircon/status.h>
#include <zircon/syscalls.h>

#include "vm/assert.h"
#include "vm/os.h"

namespace psoup {
Expand Down
3 changes: 2 additions & 1 deletion vm/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
#ifndef VM_OS_H_
#define VM_OS_H_

#include "vm/allocation.h"
#include "vm/globals.h"

namespace psoup {

class OS {
class OS : public AllStatic {
public:
static void Startup();
static void Shutdown();
Expand Down
1 change: 1 addition & 0 deletions vm/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define VM_THREAD_H_

#include "vm/allocation.h"
#include "vm/assert.h"
#include "vm/globals.h"

#if defined(OS_ANDROID) || defined(OS_FUCHSIA) || defined(OS_LINUX) || \
Expand Down
3 changes: 2 additions & 1 deletion vm/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@

#include <type_traits>

#include "vm/allocation.h"
#include "vm/assert.h"
#include "vm/globals.h"

namespace psoup {

class Utils {
class Utils : public AllStatic {
public:
template <typename T>
static constexpr inline T RoundDown(T x, intptr_t n) {
Expand Down

0 comments on commit ea97030

Please sign in to comment.