mirror of
				https://github.com/esp8266/Arduino.git
				synced 2025-10-28 17:15:26 +03:00 
			
		
		
		
	Fix malloc/free references
This commit is contained in:
		| @@ -46,6 +46,11 @@ extern void (*__init_array_end)(void); | ||||
| static cont_t g_cont; | ||||
| static os_event_t g_loop_queue[LOOP_QUEUE_SIZE]; | ||||
|  | ||||
| extern "C" void abort() | ||||
| { | ||||
|     while(1){} | ||||
| } | ||||
|  | ||||
| extern "C" void esp_yield() | ||||
| { | ||||
|     cont_yield(&g_cont); | ||||
|   | ||||
| @@ -17,20 +17,27 @@ | ||||
| */ | ||||
|  | ||||
| #include <stdlib.h> | ||||
| extern "C" { | ||||
| #include "ets_sys.h" | ||||
| #include "os_type.h" | ||||
| #include "osapi.h" | ||||
| #include "mem.h" | ||||
| #include "user_interface.h" | ||||
| } | ||||
|  | ||||
| void *operator new(size_t size) { | ||||
|   return malloc(size); | ||||
|   return os_malloc(size); | ||||
| } | ||||
|  | ||||
| void *operator new[](size_t size) { | ||||
|   return malloc(size); | ||||
|   return os_malloc(size); | ||||
| } | ||||
|  | ||||
| void operator delete(void * ptr) { | ||||
|   free(ptr); | ||||
|   os_free(ptr); | ||||
| } | ||||
|  | ||||
| void operator delete[](void * ptr) { | ||||
|   free(ptr); | ||||
|   os_free(ptr); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1,37 +1,47 @@ | ||||
| #include <stdlib.h> | ||||
| #include "stdlib_noniso.h" | ||||
|  | ||||
| char *   itoa (int val, char *s, int radix) | ||||
| long atol_internal(const char* s) | ||||
| { | ||||
|   return 0; | ||||
| } | ||||
|  | ||||
| float atof_internal(const char* s) | ||||
| { | ||||
|   return 0; | ||||
| } | ||||
|  | ||||
| char * itoa (int val, char *s, int radix) | ||||
| { | ||||
|   *s = 0; | ||||
|   return s; | ||||
| } | ||||
|  | ||||
| char *   ltoa (long val, char *s, int radix) | ||||
| char * ltoa (long val, char *s, int radix) | ||||
| { | ||||
|   *s = 0; | ||||
|   return s; | ||||
| } | ||||
|   | ||||
| char *  utoa (unsigned int val, char *s, int radix) | ||||
| char * utoa (unsigned int val, char *s, int radix) | ||||
| { | ||||
|   *s = 0; | ||||
|   return s; | ||||
| } | ||||
|   | ||||
| char *  ultoa (unsigned long val, char *s, int radix) | ||||
| char * ultoa (unsigned long val, char *s, int radix) | ||||
| { | ||||
|   *s = 0; | ||||
|   return s; | ||||
| } | ||||
|  | ||||
| char *  dtostre (double __val, char *__s, unsigned char __prec, unsigned char __flags) | ||||
| char * dtostre (double __val, char *__s, unsigned char __prec, unsigned char __flags) | ||||
| { | ||||
|   *__s = 0; | ||||
|   return __s; | ||||
| } | ||||
|   | ||||
| char *  dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) | ||||
| char * dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) | ||||
| { | ||||
|    *__s = 0; | ||||
|    return __s; | ||||
|   | ||||
| @@ -5,6 +5,9 @@ | ||||
| extern "C"{ | ||||
| #endif | ||||
|  | ||||
| long atol_internal(const char*); | ||||
|  | ||||
| float atof_internal(const char*); | ||||
|  | ||||
| char* itoa (int val, char *s, int radix); | ||||
|  | ||||
|   | ||||
							
								
								
									
										0
									
								
								cores/esp8266/user_config.h
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								cores/esp8266/user_config.h
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
		Reference in New Issue
	
	Block a user