emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I created a faster JSON parser


From: Herman , Géza
Subject: Re: I created a faster JSON parser
Date: Tue, 12 Mar 2024 16:23:59 +0100


Mattias Engdegård <mattias.engdegard@gmail.com> writes:

12 mars 2024 kl. 11.58 skrev Herman, Géza <geza.herman@gmail.com>:

You can't test that code is GC-safe, you have to show that it's correct by design.

Sure, but there has to be an explanation why the current way doesn't have any problems.

It doesn't matter -- we don't need to prove to you why you don't get a segfault, it's you who need to convince us that your code is fine.

Most C code does not need any special attention as long as it only
places Lisp roots in local variables, ie, on the C stack and in
registers. Your code keeps live roots in heap-allocated memory. It's not alone in doing that, but elsewhere we give those roots special attention, either by explicit GC marking or disabling GC during the
lifespan of those roots.

As I said your code is probably safe unless it signals an error.

Sorry, but I don't understand. If my parser puts roots in heap-allocated memory (that's true), and doesn't give such roots special attention (that's also true), then why is it probably safe?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]