Skip to content

Commit

Permalink
Fix more files
Browse files Browse the repository at this point in the history
  • Loading branch information
CelestialAmber committed Aug 2, 2024
1 parent f49b352 commit c443f26
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions libs/monolib/include/monolib/CPathUtil.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "types.h"
#include <string.h>

namespace ml{

Expand Down
1 change: 0 additions & 1 deletion libs/monolib/src/CPathUtil.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "monolib/CPathUtil.hpp"
#include "monolib/FixStr.hpp"
#include <cstring>

namespace ml{

Expand Down
15 changes: 8 additions & 7 deletions libs/monolib/src/MemManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ u32 regionIndex2;
bool lbl_80665E38;
bool lbl_80665E39;
s32 lbl_80667E50;
BOOL lbl_80667E58;



Expand Down Expand Up @@ -104,14 +105,14 @@ void MemManager_setArenaMemorySize(u32 val, bool b){
//requires func_align 4
MemBlock* MemManager_804339B8(Heap* heap, MemBlock* arg1) {
MemBlock* entryTemp = arg1;
MemBlock* tempEntry1 = entryTemp->unk8;
MemBlock* tempEntry1 = entryTemp->next;

if (tempEntry1 != entryTemp) {
memmove((void*)tempEntry1, entryTemp, sizeof(MemBlock));
entryTemp = tempEntry1;
}

entryTemp->unk8 = MemBlock::dummy(); //set the pointer to a random known value
entryTemp->next = (MemBlock*)MemBlock::dummyDataPtr(); //set the pointer to a random known value
MemBlock* currentEntry = heap->head;

//Go to the end of the list
Expand Down Expand Up @@ -261,11 +262,6 @@ u32 MemManager_804348C0(u8* arg0, u32 arg1) {
return (var_r5 >> 8) & 0xFFFF;
}

//dummy operator new
void* operator new(u32 arg0) {
return 0;
}

static inline void deallocate(void* p){
if(p != nullptr){
if(regionIndex1 != -1){
Expand Down Expand Up @@ -314,6 +310,11 @@ static inline void deallocate(void* p){

}

//dummy operator new
void* operator new(u32 arg0) {
return 0;
}

void operator delete(void* p) {
mtl::deallocate(p);
}
Expand Down

0 comments on commit c443f26

Please sign in to comment.