summaryrefslogtreecommitdiff
path: root/euler/source/memory/new.cpp
blob: 931328f9072ced067e03b3833f120acd4153ca17 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <euler/heap.hpp>

void *operator new(uint64_t size) {
  void *ptr = euler::alloc(size + 8);
  *(uint64_t *)ptr = size + 8;
  return (uint8_t *)ptr + 8;
}

void *operator new[](uint64_t size) {
  void *ptr = euler::alloc(size + 8);
  *(uint64_t *)ptr = size + 8;
  return (uint8_t *)ptr + 8;
}