system profiler: revert use of BytePointer.
This went through review way too fast once again. I did warn that these changes were completely untested, and indeed this one was broken. Be very careful when pressing the submit button, please! Change-Id: I6e0230efe94830033f5427451f67fe6ce29a28e6 Reviewed-on: https://review.haiku-os.org/c/1184 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
6ff7e25bd0
commit
fb7498fe2e
@@ -7,7 +7,6 @@
|
|||||||
#include <system_profiler.h>
|
#include <system_profiler.h>
|
||||||
|
|
||||||
#include <AutoDeleter.h>
|
#include <AutoDeleter.h>
|
||||||
#include <BytePointer.h>
|
|
||||||
#include <Referenceable.h>
|
#include <Referenceable.h>
|
||||||
|
|
||||||
#include <util/AutoLock.h>
|
#include <util/AutoLock.h>
|
||||||
@@ -1339,8 +1338,8 @@ SystemProfiler::_AllocateBuffer(size_t size, int event, int cpu, int count)
|
|||||||
// Buffer is wrapped or needs wrapping.
|
// Buffer is wrapped or needs wrapping.
|
||||||
if (end < fBufferCapacity) {
|
if (end < fBufferCapacity) {
|
||||||
// not wrapped yet, but needed
|
// not wrapped yet, but needed
|
||||||
BytePointer<system_profiler_event_header> header(
|
system_profiler_event_header* header
|
||||||
fBufferBase + end);
|
= (system_profiler_event_header*)(fBufferBase + end);
|
||||||
header->event = B_SYSTEM_PROFILER_BUFFER_END;
|
header->event = B_SYSTEM_PROFILER_BUFFER_END;
|
||||||
fBufferSize = fBufferCapacity - fBufferStart;
|
fBufferSize = fBufferCapacity - fBufferStart;
|
||||||
end = 0;
|
end = 0;
|
||||||
@@ -1353,7 +1352,8 @@ SystemProfiler::_AllocateBuffer(size_t size, int event, int cpu, int count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BytePointer<system_profiler_event_header> header(fBufferBase + end);
|
system_profiler_event_header* header
|
||||||
|
= (system_profiler_event_header*)(fBufferBase + end);
|
||||||
header->event = event;
|
header->event = event;
|
||||||
header->cpu = cpu;
|
header->cpu = cpu;
|
||||||
header->size = size - sizeof(system_profiler_event_header);
|
header->size = size - sizeof(system_profiler_event_header);
|
||||||
|
|||||||
Reference in New Issue
Block a user