1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 07:22:43 +01:00

Size -> size_t

This commit is contained in:
Eelco Dolstra 2019-04-23 22:47:30 +02:00
parent ba36d43d46
commit 35b76b21ee
5 changed files with 26 additions and 27 deletions

View file

@ -239,8 +239,8 @@ void GC::gc()
// Go through all the arenas and add free objects to the
// appropriate freelists.
Size totalObjectsFreed = 0;
Size totalWordsFreed = 0;
size_t totalObjectsFreed = 0;
size_t totalWordsFreed = 0;
for (auto & arena : arenas) {
auto [objectsFreed, wordsFreed] = freeUnmarked(arena);
@ -252,10 +252,10 @@ void GC::gc()
totalWordsFreed * WORD_SIZE, totalObjectsFreed, marked);
}
std::pair<Size, Size> GC::freeUnmarked(Arena & arena)
std::pair<size_t, size_t> GC::freeUnmarked(Arena & arena)
{
Size objectsFreed = 0;
Size wordsFreed = 0;
size_t objectsFreed = 0;
size_t wordsFreed = 0;
auto end = arena.start + arena.size;
auto pos = arena.start;
@ -272,7 +272,7 @@ std::pair<Size, Size> GC::freeUnmarked(Arena & arena)
auto obj = (Object *) pos;
auto tag = obj->type;
Size objSize;
size_t objSize;
if (tag >= tInt && tag <= tFloat) {
objSize = ((Value *) obj)->words();
} else {
@ -326,7 +326,7 @@ std::pair<Size, Size> GC::freeUnmarked(Arena & arena)
} else {
//debug("FREE OBJECT %x %d %d", obj, obj->type, objSize);
#if GC_DEBUG
for (Size i = 0; i < objSize; ++i)
for (size_t i = 0; i < objSize; ++i)
((Word *) obj)[i] = 0xdeadc0dedeadbeefULL;
#endif
objectsFreed += 1;