1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00
Bogdan Marinescu 9dffa3ce81 New feature: memory error callback
This PR adds the possibility of specifying a memory error callback in
the "ram" element of the "config" section. The new configuration
attribute is called "memory_error_callback" and its value is the name of
a function with the signature "void f(size_t)" that will be called
automatically in the following cases:

- when malloc, calloc, or realloc (with the 'size' argument greater than
  0) return NULL. The callback function will be called with the 'size'
  argument of the allocation function.
- when the allocator encounters an internal error (only when using the
  'multiple' allocator). The callback function will be called with the
  argument set to 0.

For now, this feature is only availabsle when using the multiple
allocator or the simple allocator, not the built-in libc allocator.

Usage example (in the board configuration file):

```
   config = {
     ram = { memory_error_callback = "memory_error" }
   }
```
2018-06-11 21:48:46 +03:00
..
2018-05-19 23:02:27 +03:00
2009-06-22 23:49:21 +00:00
2018-06-11 21:48:46 +03:00
2013-10-30 00:38:46 -08:00
2017-07-30 20:52:27 +02:00
2013-10-30 00:38:46 -08:00
2011-10-24 19:11:35 -05:00
2014-03-19 21:48:56 -08:00
2018-06-01 01:36:54 +03:00
2018-05-30 18:57:23 +03:00
2018-06-11 21:48:46 +03:00
2013-04-01 23:10:36 +03:00
2017-08-03 16:29:31 +02:00