D.S

dev.mysql.com

MySQL: mysys/my_malloc.cc File Reference

MySQL: mysys/my_malloc.cc File Reference MySQL  8.0.0 Source Code Documentation Main Page Related Pages Modules Namespaces Classes Files File List File Members Classes | Macros | Typedefs | Functions my_malloc.cc File Reference #include " mysys_priv.h " #include " my_sys.h " #include " mysys_err.h " #include < m_string.h > #include " my_thread_local.h " #include " mysql/psi/mysql_memory.h " Classes struct   my_memory_header   Macros #define  USE_MALLOC_WRAPPER   #define  HEADER_SIZE    32   #define  MAGIC    1234   #define  USER_TO_HEADER ( P )   ( ( my_memory_header *) (((char *) P ) - HEADER_SIZE ))   #define  HEADER_TO_USER ( P )   ( ((char*) P ) + HEADER_SIZE )   Typedefs typedef struct my_memory_header   my_memory_header   Functions static void *  my_raw_malloc (size_t size, myf my_flags)   Allocate a sized block of memory. More...   static void  my_raw_free (void *ptr)   Free memory allocated with my_raw_malloc. More...   void *  my_malloc ( PSI_memory_key key , size_t size, myf flags )   void *  my_realloc ( PSI_memory_key key , void *ptr, size_t size, myf flags )   void  my_claim (const void *ptr)   void  my_free (void *ptr)   void *  my_memdup ( PSI_memory_key key , const void *from, size_t length, myf my_flags)   char *  my_strdup ( PSI_memory_key key , const char *from, myf my_flags)   char *  my_strndup ( PSI_memory_key key , const char *from, size_t length, myf my_flags)   Macro Definition Documentation #define HEADER_SIZE   32 #define HEADER_TO_USER (   P )    ( ((char*) P ) + HEADER_SIZE ) #define MAGIC   1234 #define USE_MALLOC_WRAPPER #define USER_TO_HEADER (   P )    ( ( my_memory_header *) (((char *) P ) - HEADER_SIZE )) Typedef Documentation typedef struct my_memory_header my_memory_header Function Documentation void my_claim ( const void *  ptr ) void my_free ( void *  ptr ) void* my_malloc ( PSI_memory_key   key, size_t  size, myf   flags  ) void* my_memdup ( PSI_memory_key   key, const void *  from, size_t  length, myf   my_flags  ) static void my_raw_free ( void *  ptr ) static Free memory allocated with my_raw_malloc. Remarks Relies on free being able to handle a NULL argument. Parameters ptr Pointer to the memory allocated by my_raw_malloc. static void * my_raw_malloc ( size_t  size, myf   my_flags  ) static Allocate a sized block of memory. Parameters size The size of the memory block in bytes. my_flags Failure action modifiers (bitmasks). Returns A pointer to the allocated memory block, or NULL on failure. void* my_realloc ( PSI_memory_key   key, void *  ptr, size_t  size, myf   flags  ) char* my_strdup ( PSI_memory_key   key, const char *  from, myf   my_flags  ) char* my_strndup ( PSI_memory_key   key, const char *  from, size_t  length, myf   my_flags  ) mysys my_malloc.cc Generated by 1.8.11