Skip to content

Commit

Permalink
Remove legacy heap [re]alloc templates
Browse files Browse the repository at this point in the history
  • Loading branch information
djphoenix committed Nov 22, 2016
1 parent f1f11cf commit 0215689
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/kernlib/include/list.hpp
Expand Up @@ -29,7 +29,7 @@ class List {
Item& insert() {
if (count == capacity) {
capacity += MAX(256 / sizeof(Item), (size_t)1);
items = Heap::realloc(items, sizeof(Item) * capacity);
items = static_cast<Item*>(Heap::realloc(items, sizeof(Item) * capacity));
}
return items[count++];
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform/cpu.cpp
Expand Up @@ -206,7 +206,7 @@ char* CPU::getFeaturesStr() {
end--;
end[0] = 0;

buf = Heap::realloc(buf, strlen(buf) + 1);
buf = static_cast<char*>(Heap::realloc(buf, strlen(buf) + 1));

return buf;
}
Expand Down
9 changes: 0 additions & 9 deletions src/platform/include/heap.hpp
Expand Up @@ -30,15 +30,6 @@ class Heap {
static void* realloc(void *addr, size_t size, size_t align = 4);

static void free(void* addr);

template<typename T> static inline T* alloc(
size_t size = sizeof(T), size_t align = 4) {
return static_cast<T*>(alloc(size, align));
}
template<typename T> static inline T* realloc(
T *addr, size_t size, size_t align = 4) {
return static_cast<T*>(realloc(static_cast<void*>(addr), size, align));
}
};

#define ALIGNED_NEW(align) \
Expand Down

0 comments on commit 0215689

Please sign in to comment.