feature: Tracer O(1) ring buffer refactor
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

- Replaced O(n) shift loop + StringCopy/kalloc/kfree with O(1) ring
  buffer storing PChar pointers directly (zero allocation).
- Eliminated mod operator (causes int64 promotion + broken RTL helpers
  on i386 bare-metal); uses pure uint32 branch arithmetic.
- Removed dead code: PTracerEntry/TTracerEntry linked list types,
  head/tail PTracerEntry vars, c_lock boolean
- Dropped lmemorymanager and serial from uses clause
- pop_trace remains as no-op stub for ABI compat
- get_trace_N uses underflow-safe index: if head >= idx then
  head - idx else MAX_TRACE - (idx - head)
- Added print_traces debug helper
This commit is contained in:
t3hn3rd committed 2026-03-01 21:26:35 +00:00
1 parent afdc83eaf6
commit f53afc1d2d
2 files changed
+51 -33

No files matched your search

+9 -2
View File
@@ -581,12 +581,13 @@ begin
syslog.writestring(' EIP: '); syslog.writehex(IntSpec^.EIP); syslog.writestring(' CS: '); syslog.writehex(IntSpec^.CS); syslog.writestring(' EFLAGS: '); syslog.writehexln(IntSpec^.EFLAGS);
syslog.writestringln(' ');
end;
syslog.writestring('Call Stack: ');
tracer.freeze;
syslog.writestring('Call Stack: ');
trace:= tracer.get_last_trace;
if trace <> nil then begin
syslog.writestring('[-0] ');
syslog.writestringln(trace);
for i:=1 to tracer.get_trace_count-7 do begin
for i:=1 to tracer.get_trace_count-1 do begin
trace:= tracer.get_trace_N(i);
if trace <> nil then begin
syslog.writestring(' [');
@@ -594,6 +595,12 @@ begin
syslog.writeint(i);
syslog.writestring('] ');
syslog.writestringln(trace);
end else begin
syslog.writestring(' [');
syslog.writestring('-');
syslog.writeint(i);
syslog.writestring('] ');
syslog.writestringln('?????????');
end;
end;
end else begin