Skip to content

Commit

Permalink
correct obj dump
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Peck committed May 26, 2024
1 parent 0aa999d commit 7a88edf
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions BitFaster.Caching.UnitTests/Lru/LruItemMemoryLayoutDumps.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BitFaster.Caching.Lru;
using System;
using BitFaster.Caching.Lru;
using ObjectLayoutInspector;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -16,23 +17,23 @@ public LruItemMemoryLayoutDumps(ITestOutputHelper testOutputHelper)

//Type layout for 'LruItem`2'
//Size: 24 bytes. Paddings: 2 bytes (%8 of empty space)
//|================================================|
//| Object Header (8 bytes) |
//|------------------------------------------------|
//| Method Table Ptr (8 bytes) |
//|================================================|
//| 0-7: Object Key (8 bytes) |
//|------------------------------------------------|
//| 8-15: Object <Value>k__BackingField (8 bytes) |
//|------------------------------------------------|
//| 16-19: Int32 sequence (4 bytes) |
//|------------------------------------------------|
//| 20: Boolean wasAccessed (1 byte) |
//|------------------------------------------------|
//| 21: Boolean wasRemoved (1 byte) |
//|------------------------------------------------|
//| 22-23: padding (2 bytes) |
//|================================================|
//|=====================================|
//| Object Header (8 bytes) |
//|-------------------------------------|
//| Method Table Ptr (8 bytes) |
//|=====================================|
//| 0-7: Object data (8 bytes) |
//|-------------------------------------|
//| 8-15: Object Key (8 bytes) |
//|-------------------------------------|
//| 16-19: Int32 sequence (4 bytes) |
//|-------------------------------------|
//| 20: Boolean wasAccessed (1 byte) |
//|-------------------------------------|
//| 21: Boolean wasRemoved (1 byte) |
//|-------------------------------------|
//| 22-23: padding (2 bytes) |
//|=====================================|
[Fact]
public void DumpLruItem()
{
Expand All @@ -47,9 +48,9 @@ public void DumpLruItem()
//|---------------------------------------------------|
//| Method Table Ptr (8 bytes) |
//|===================================================|
//| 0-7: Object Key (8 bytes) |
//| 0-7: Object data (8 bytes) |
//|---------------------------------------------------|
//| 8-15: Object <Value>k__BackingField (8 bytes) |
//| 8-15: Object Key (8 bytes) |
//|---------------------------------------------------|
//| 16-19: Int32 sequence (4 bytes) |
//|---------------------------------------------------|
Expand Down

0 comments on commit 7a88edf

Please sign in to comment.