summaryrefslogtreecommitdiff
path: root/src/code/__osMalloc.c
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2021-09-04 15:33:19 +0200
committerGitHub <noreply@github.com>2021-09-04 15:33:19 +0200
commit81830a6e8bfa62681924c0b535cfd1adf0423860 (patch)
tree460ce19a4fcb84438d307cfdbcbbc3f18afe788a /src/code/__osMalloc.c
parent9b840ad84229dee3afc64e49df1250e06bfc7bc2 (diff)
Cleanup translation comments (#924)
* `// Translates to:` -> `//` * `// Translation: ([^"].*)` -> `// "$1"` * Manual cleanup * Manual cleanup in `src/code/` * Use more lowercase for some all caps translations * Move translations to end of lines where it fits under 100 bytes * Move one translation to end of line manually * Run formatter * Cleanup in EnHeishi1 as suggested by Roman * Update src/code/z_play.c Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
Diffstat (limited to 'src/code/__osMalloc.c')
-rw-r--r--src/code/__osMalloc.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/code/__osMalloc.c b/src/code/__osMalloc.c
index 089ee5975..b42effe08 100644
--- a/src/code/__osMalloc.c
+++ b/src/code/__osMalloc.c
@@ -574,13 +574,13 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
} else {
node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode));
if (newSize == node->size) {
- // Does nothing because the memory block size does not change
+ // "Does nothing because the memory block size does not change"
osSyncPrintf("メモリブロックサイズが変わらないためなにもしません\n");
} else if (node->size < newSize) {
next = ArenaImpl_GetNextBlock(node);
sizeDiff = newSize - node->size;
if ((u32)next == ((u32)node + node->size + sizeof(ArenaNode)) && next->isFree && next->size >= sizeDiff) {
- // Merge because there is a free block after the current memory block
+ // "Merge because there is a free block after the current memory block"
osSyncPrintf("現メモリブロックの後ろにフリーブロックがあるので結合します\n");
next->size -= sizeDiff;
overNext = ArenaImpl_GetNextBlock(next);
@@ -592,7 +592,7 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
node->size = newSize;
func_801068B0(newNext, next, sizeof(ArenaNode)); // memcpy
} else {
- // Allocate a new memory block and move the contents
+ // "Allocate a new memory block and move the contents"
osSyncPrintf("新たにメモリブロックを確保して内容を移動します\n");
newAlloc = __osMalloc_NoLock(arena, newSize);
if (newAlloc != NULL) {
@@ -605,7 +605,7 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
next2 = ArenaImpl_GetNextBlock(node);
if (next2 != NULL && next2->isFree) {
blockSize = ALIGN16(newSize) + sizeof(ArenaNode);
- // Increased free block behind current memory block
+ // "Increased free block behind current memory block"
osSyncPrintf("現メモリブロックの後ろのフリーブロックを大きくしました\n");
newNext2 = (ArenaNode*)((u32)node + blockSize);
localCopy = *next2;
@@ -619,7 +619,7 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
}
} else if (newSize + sizeof(ArenaNode) < node->size) {
blockSize = ALIGN16(newSize) + sizeof(ArenaNode);
- // Generated because there is no free block after the current memory block
+ // "Generated because there is no free block after the current memory block"
osSyncPrintf("現メモリブロックの後ろにフリーブロックがないので生成します\n");
newNext2 = (ArenaNode*)((u32)node + blockSize);
newNext2->next = ArenaImpl_GetNextBlock(node);
@@ -634,7 +634,7 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
overNext2->prev = newNext2;
}
} else {
- // There is no room to generate free blocks
+ // "There is no room to generate free blocks"
osSyncPrintf("フリーブロック生成するだけの空きがありません\n");
ptr = NULL;
}
@@ -683,8 +683,7 @@ void __osDisplayArena(Arena* arena) {
ArenaNode* next;
if (!__osMallocIsInitalized(arena)) {
- // Arena is not initalized
- osSyncPrintf("アリーナは初期化されていません\n");
+ osSyncPrintf("アリーナは初期化されていません\n"); // "Arena is not initalized"
return;
}
@@ -694,9 +693,8 @@ void __osDisplayArena(Arena* arena) {
freeSize = 0;
allocatedSize = 0;
- // Arena contents (0x%08x)
- osSyncPrintf("アリーナの内容 (0x%08x)\n", arena);
- // Memory node range status size [time s ms us ns: TID: src: line]
+ osSyncPrintf("アリーナの内容 (0x%08x)\n", arena); // "Arena contents (0x%08x)"
+ // "Memory node range status size [time s ms us ns: TID: src: line]"
osSyncPrintf("メモリブロック範囲 status サイズ [時刻 s ms us ns: TID:src:行]\n");
iter = arena->head;
@@ -730,9 +728,12 @@ void __osDisplayArena(Arena* arena) {
iter = next;
}
- osSyncPrintf("確保ブロックサイズの合計 0x%08x バイト\n", allocatedSize); // Total reserved node size 0x%08x bytes
- osSyncPrintf("空きブロックサイズの合計 0x%08x バイト\n", freeSize); // Total free node size 0x%08x bytes
- osSyncPrintf("最大空きブロックサイズ 0x%08x バイト\n", maxFree); // Maximum free node size 0x%08x bytes
+ // "Total reserved node size 0x%08x bytes"
+ osSyncPrintf("確保ブロックサイズの合計 0x%08x バイト\n", allocatedSize);
+ // "Total free node size 0x%08x bytes"
+ osSyncPrintf("空きブロックサイズの合計 0x%08x バイト\n", freeSize);
+ // "Maximum free node size 0x%08x bytes"
+ osSyncPrintf("最大空きブロックサイズ 0x%08x バイト\n", maxFree);
ArenaImpl_Unlock(arena);
}
@@ -792,12 +793,12 @@ u32 __osCheckArena(Arena* arena) {
u32 error = 0;
ArenaImpl_Lock(arena);
- // Checking the contents of the arena. . . (%08x)
+ // "Checking the contents of the arena. . . (%08x)"
osSyncPrintf("アリーナの内容をチェックしています... (%08x)\n", arena);
iter = arena->head;
while (iter != NULL) {
if (iter && iter->magic == NODE_MAGIC) {
- // Oops!! (%08x %08x)
+ // "Oops!! (%08x %08x)"
osSyncPrintf(VT_COL(RED, WHITE) "おおっと!! (%08x %08x)\n" VT_RST, iter, iter->magic);
error = 1;
break;
@@ -805,8 +806,7 @@ u32 __osCheckArena(Arena* arena) {
iter = ArenaImpl_GetNextBlock(iter);
}
if (error == 0) {
- // The arena is still going well
- osSyncPrintf("アリーナはまだ、いけそうです\n");
+ osSyncPrintf("アリーナはまだ、いけそうです\n"); // "The arena is still going well"
}
ArenaImpl_Unlock(arena);