emacs-devel
[Top][All Lists]
Advanced

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

Re: How to add pseudo vector types


From: Perry E. Metzger
Subject: Re: How to add pseudo vector types
Date: Fri, 23 Jul 2021 16:01:14 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.0

On 7/23/21 15:10, Eli Zaretskii wrote:

Abort, it seems:
static inline void *ts_malloc_default(size_t size) {
   void *result = malloc(size);
   if (size > 0 && !result) {
     fprintf(stderr, "tree-sitter failed to allocate %zu bytes", size);
     exit(1);
   }
   return result;
}
We must replace this function, if only because the MS-Windows build of
Emacs uses a custom malloc implementation.  Does TS allow the client
to use its own malloc?

Certainly more graceful allocation error behavior would be necessary in an Emacs context even on Unix-like operating systems. An unexpected hard exit could result in loss of data for the user.

Perry





reply via email to

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