libsysprof-analyze: remove 32-bit time_offset optimization

This simply isn't worth the memory saves for the loss of precision. Just
use a 64-bit and store the actual time offset.
This commit is contained in:
Christian Hergert
2023-07-13 14:36:40 -07:00
parent ace5716562
commit 0bc18816d8
2 changed files with 2 additions and 6 deletions

View File

@ -31,10 +31,10 @@ struct _SysprofDocumentFrame
GObject parent;
GMappedFile *mapped_file;
const SysprofCaptureFrame *frame;
gint64 time_offset;
guint32 frame_len : 16;
guint32 needs_swap : 1;
guint32 padding : 15;
guint32 time_offset;
};
struct _SysprofDocumentFrameClass

View File

@ -147,7 +147,6 @@ _sysprof_document_frame_new (GMappedFile *mapped_file,
gint64 end_time)
{
SysprofDocumentFrame *self;
gint64 time_offset;
GType gtype;
switch (frame->type)
@ -220,10 +219,7 @@ _sysprof_document_frame_new (GMappedFile *mapped_file,
self->frame_len = frame_len;
self->needs_swap = !!needs_swap;
time_offset = CLAMP (sysprof_document_frame_get_time (self) - begin_time, 0, G_MAXINT64);
/* loose precision here after about 71 minutes */
self->time_offset = (guint)time_offset;
self->time_offset = CLAMP (sysprof_document_frame_get_time (self) - begin_time, 0, G_MAXINT64);
return self;
}