|
ReactOS 0.4.16-dev-2206-gc56950d
|
#include "libxml.h"#include <string.h>#include <stdlib.h>#include <ctype.h>#include <time.h>#include <libxml/xmlmemory.h>#include <libxml/xmlerror.h>#include <libxml/parser.h>#include <libxml/threads.h>#include "private/memory.h"#include "private/threads.h"
Go to the source code of this file.
Classes | |
| struct | memnod |
Macros | |
| #define | IN_LIBXML |
| #define | MEMTAG 0x5aa5U |
| #define | MALLOC_TYPE 1 |
| #define | REALLOC_TYPE 2 |
| #define | STRDUP_TYPE 3 |
| #define | MALLOC_ATOMIC_TYPE 4 |
| #define | REALLOC_ATOMIC_TYPE 5 |
| #define | ALIGN_SIZE sizeof(double) |
| #define | HDR_SIZE sizeof(MEMHDR) |
| #define | RESERVE_SIZE |
| #define | MAX_SIZE_T ((size_t)-1) |
| #define | CLIENT_2_HDR(a) ((void *) (((char *) (a)) - RESERVE_SIZE)) |
| #define | HDR_2_CLIENT(a) ((void *) (((char *) (a)) + RESERVE_SIZE)) |
| #define | Mem_Tag_Err(a) debugmem_tag_error(a); |
| #define | TEST_POINT |
Typedefs | |
| typedef struct memnod | MEMHDR |
Variables | |
| static unsigned long | debugMemSize = 0 |
| static unsigned long | debugMemBlocks = 0 |
| static unsigned long | debugMaxMemSize = 0 |
| static xmlMutex | xmlMemMutex |
| static unsigned int | block =0 |
| static unsigned int | xmlMemStopAtBlock = 0 |
| static void * | xmlMemTraceBlockAt = NULL |
Definition at line 89 of file xmlmemory.c.
Definition at line 97 of file xmlmemory.c.
Definition at line 98 of file xmlmemory.c.
Definition at line 91 of file xmlmemory.c.
| #define IN_LIBXML |
Definition at line 7 of file xmlmemory.c.
| #define MALLOC_ATOMIC_TYPE 4 |
Definition at line 69 of file xmlmemory.c.
| #define MALLOC_TYPE 1 |
Definition at line 66 of file xmlmemory.c.
Definition at line 95 of file xmlmemory.c.
| #define Mem_Tag_Err | ( | a | ) | debugmem_tag_error(a); |
Definition at line 113 of file xmlmemory.c.
| #define MEMTAG 0x5aa5U |
Definition at line 64 of file xmlmemory.c.
| #define REALLOC_ATOMIC_TYPE 5 |
Definition at line 70 of file xmlmemory.c.
| #define REALLOC_TYPE 2 |
Definition at line 67 of file xmlmemory.c.
| #define RESERVE_SIZE |
Definition at line 92 of file xmlmemory.c.
| #define STRDUP_TYPE 3 |
Definition at line 68 of file xmlmemory.c.
| #define TEST_POINT |
Definition at line 116 of file xmlmemory.c.
Definition at line 734 of file xmlmemory.c.
xmlCleanupMemory:
DEPRECATED: This function is a no-op. Call xmlCleanupParser to free global state but see the warnings there. xmlCleanupParser should be only called once at program exit. In most cases, you don't have call cleanup functions at all.
Definition at line 870 of file xmlmemory.c.
xmlCleanupMemoryInternal:
Free up all the memory allocated by the library for its own use. This should not be called by user level code.
Definition at line 880 of file xmlmemory.c.
Referenced by xmlCleanupParser().
| int xmlGcMemGet | ( | xmlFreeFunc * | freeFunc, |
| xmlMallocFunc * | mallocFunc, | ||
| xmlMallocFunc * | mallocAtomicFunc, | ||
| xmlReallocFunc * | reallocFunc, | ||
| xmlStrdupFunc * | strdupFunc | ||
| ) |
xmlGcMemGet: @freeFunc: place to save the free() function in use @mallocFunc: place to save the malloc() function in use @mallocAtomicFunc: place to save the atomic malloc() function in use @reallocFunc: place to save the realloc() function in use @strdupFunc: place to save the strdup() function in use
Provides the memory access functions set currently in use The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas useful for garbage collected memory allocators
Returns 0 on success
Definition at line 1003 of file xmlmemory.c.
| int xmlGcMemSetup | ( | xmlFreeFunc | freeFunc, |
| xmlMallocFunc | mallocFunc, | ||
| xmlMallocFunc | mallocAtomicFunc, | ||
| xmlReallocFunc | reallocFunc, | ||
| xmlStrdupFunc | strdupFunc | ||
| ) |
xmlGcMemSetup: @freeFunc: the free() function to use @mallocFunc: the malloc() function to use @mallocAtomicFunc: the malloc() function to use for atomic allocations @reallocFunc: the realloc() function to use @strdupFunc: the strdup() function to use
Override the default memory access functions with a new set This has to be called before any other libxml routines ! The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas useful for garbage collected memory allocators
Should this be blocked if there was already some allocations done ?
Returns 0 on success
Definition at line 967 of file xmlmemory.c.
xmlInitMemory:
DEPRECATED: Alias for xmlInitParser.
Definition at line 833 of file xmlmemory.c.
xmlInitMemoryInternal:
Initialize the memory layer.
Returns 0 on success
Definition at line 846 of file xmlmemory.c.
Referenced by xmlInitParser().
Definition at line 210 of file xmlmemory.c.
xmlMallocBreakpoint:
Breakpoint to use in conjunction with xmlMemStopAtBlock. When the block number reaches the specified value this function is called. One need to add a breakpoint to it to get the context in which the given block is allocated.
Definition at line 128 of file xmlmemory.c.
Referenced by xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemFree(), xmlMemStrdupLoc(), and xmlReallocLoc().
Definition at line 145 of file xmlmemory.c.
Referenced by xmlMemMalloc(), and xmlReallocLoc().
xmlMemBlocks:
Provides the number of memory areas currently allocated
Returns an int representing the number of blocks
Definition at line 557 of file xmlmemory.c.
xmlMemDisplay: @fp: a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist
show in-extenso the memory blocks allocated
Definition at line 644 of file xmlmemory.c.
Referenced by debugmem_tag_error(), and xmlMemoryDump().
xmlMemDisplayLast: @fp: a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist @nbBytes: the amount of memory to dump
the last nbBytes of memory allocated and not freed, useful for dumping the memory left allocated between two places at runtime.
Definition at line 577 of file xmlmemory.c.
xmlMemFree: @ptr: the memory block pointer
a free() equivalent, with error checking.
Definition at line 381 of file xmlmemory.c.
| int xmlMemGet | ( | xmlFreeFunc * | freeFunc, |
| xmlMallocFunc * | mallocFunc, | ||
| xmlReallocFunc * | reallocFunc, | ||
| xmlStrdupFunc * | strdupFunc | ||
| ) |
xmlMemGet: @freeFunc: place to save the free() function in use @mallocFunc: place to save the malloc() function in use @reallocFunc: place to save the realloc() function in use @strdupFunc: place to save the strdup() function in use
Provides the memory access functions set currently in use
Returns 0 on success
Definition at line 939 of file xmlmemory.c.
xmlMemMalloc: @size: an int specifying the size in byte to allocate.
a malloc() equivalent, with logging of the allocation info.
Returns a pointer to the allocated area or NULL in case of lack of memory.
Definition at line 272 of file xmlmemory.c.
xmlMemoryDump:
Dump in-extenso the memory blocks allocated to the file .memorylist
Definition at line 802 of file xmlmemory.c.
xmlMemoryStrdup: @str: the initial string pointer
a strdup() equivalent, with logging of the allocation info.
Returns a pointer to the new string or NULL if allocation error occurred.
Definition at line 510 of file xmlmemory.c.
xmlMemRealloc: @ptr: the initial memory block pointer @size: an int specifying the size in byte to allocate.
a realloc() equivalent, with logging of the allocation info.
Returns a pointer to the allocated area or NULL in case of lack of memory.
Definition at line 370 of file xmlmemory.c.
| int xmlMemSetup | ( | xmlFreeFunc | freeFunc, |
| xmlMallocFunc | mallocFunc, | ||
| xmlReallocFunc | reallocFunc, | ||
| xmlStrdupFunc | strdupFunc | ||
| ) |
xmlMemSetup: @freeFunc: the free() function to use @mallocFunc: the malloc() function to use @reallocFunc: the realloc() function to use @strdupFunc: the strdup() function to use
Override the default memory access functions with a new set This has to be called before any other libxml routines !
Should this be blocked if there was already some allocations done ?
Returns 0 on success
Definition at line 909 of file xmlmemory.c.
xmlMemShow: @fp: a FILE descriptor used as the output file @nr: number of entries to dump
show a show display of the memory allocated, and dump the @nr last allocated areas which were not freed
Definition at line 758 of file xmlmemory.c.
xmlMemSize: @ptr: pointer to the memory allocation
Returns the size of a memory allocation.
Definition at line 522 of file xmlmemory.c.
Definition at line 446 of file xmlmemory.c.
Referenced by xmlMemoryStrdup().
xmlMemUsed:
Provides the amount of memory currently allocated
Returns an int representing the amount of memory allocated.
Definition at line 544 of file xmlmemory.c.
Definition at line 290 of file xmlmemory.c.
Referenced by xmlMemRealloc().
Definition at line 101 of file xmlmemory.c.
Referenced by __declspec(), __find_get_block(), __getblk(), _aligned_free_base(), _aligned_msize_base(), _aligned_offset_realloc_base(), _aligned_offset_recalloc_base(), _aligned_realloc_base(), _aligned_recalloc_base(), _chm_decompress_block(), _chm_get_cmpblock_bounds(), absynth_1to1_i486(), add_block(), add_data_block(), add_data_to_folder(), add_typeinfo_block(), adns__transfer_interim(), tinyxml2::MemPoolT< SIZE >::Alloc(), alloc_pioinfo_block(), append_data(), AVIFILE_SamplesToBlock(), Base64ToBinary(), begin_block_execution(), blake2b_compress(), block_size(), BlockChainStream_GetBlockAtOffset(), chksum_crc32(), codeview_snarf(), copy_data_blocks(), create_gpe_block(), create_io_inherit_block(), create_library_block(), ctl2_alloc_segment(), d3dx_effect_ApplyParameterBlock(), d3dx_effect_cleanup(), decode_block(), decode_mcu(), decode_mcu_AC_first(), decode_mcu_AC_refine(), decode_mcu_DC_first(), decode_mcu_sub(), desfunc(), detect_gpes(), do_find_gpe(), do_for_all_gpes(), do_initialize_gpe_block(), dwarf2_parse_inlined_subroutine(), dwarf2_parse_subprogram_block(), dwarf2_parse_variable(), encode_mcu(), encode_mcu_AC_first(), encode_mcu_AC_refine(), encode_one_block(), Slicer::evalRBArray(), ext2_alloc_block(), ext2_block_map(), ext2_mkdir(), ext2_new_dir_block(), ext2_read_block(), ext2_test_block_bitmap(), ext2_test_block_bitmap_range(), ext2_write_block(), Ext2AddDotEntries(), Ext2LoadBuffer(), Ext2SaveBuffer(), Ext2ZeroBuffer(), ext3_add_entry(), ext3_append(), ext3_bread(), ext3_find_entry(), ext4_block_in_group(), ext4_ext_binsearch(), ext4_ext_binsearch_idx(), ext4_ext_find_goal(), ext4_ext_pblock(), ext4_ext_rm_leaf(), ext4_ext_search_right(), ext4_find_extent(), ext4_free_blocks(), ext4_idx_pblock(), ext4_new_meta_blocks(), ext_to_block(), extents_bread(), extents_bwrite(), FCIDestroy(), FDSA_InsertItem(), find_last_block(), for(), for_each_gpe_block(), frame_reset_post_end_block(), frame_setup_base_scope(), free_data_block(), free_folder(), free_parameter_block(), ft_free(), ft_mem_alloc(), ft_mem_qalloc(), ft_mem_qrealloc(), ft_mem_realloc(), ft_realloc(), fwpolicy2_get_BlockAllInboundTraffic(), fwpolicy2_put_BlockAllInboundTraffic(), get_block_bh(), get_block_bh_mdl(), get_block_bh_pin(), get_cache_glyph(), get_cache_glyph_widths(), get_file_version(), get_valid_parameter_block(), gl_destroy_list(), gpe_block_apply_action(), gpe_block_mask_safe(), gpe_from_block(), hash(), htest_one_block(), IAVIStream_fnRead(), idx_to_block(), if(), III_hybrid(), ImmDestroyIMCC(), ldap_memfreeA(), ldap_memfreeW(), map_bh(), maybe_end_block(), msvcrt_create_io_inherit_block(), ntom_ins2outs(), OleUnblockServer(), ParseSharedPacket(), peek_next_op(), pending_flush(), PerfDeleteInstance(), record_parameter(), sb_bread(), sb_find_get_block(), sb_getblk(), sb_getblk_zero(), select_heap(), set_cache_glyph(), set_cache_glyph_widths(), sha1_transform(), stabs_parse(), StartBalanceW(), surface_cpu_blt_compressed(), swap_endian(), symt_add_func_local(), symt_close_func_block(), symt_enum_locals_helper(), symt_open_func_block(), test_effect_parameter_block(), test_FDICopy(), test_fdsa(), trace_method_abort(), uacpi_deinitialize_events(), UDFProcessSequence(), UDFReadVDS(), UDFUpdateVDS(), UDFVerifySequence(), uninstall_gpe_block(), update_scope(), urlcache_entry_alloc(), urlcache_entry_free(), WerRegisterMemoryBlock(), WerUnregisterMemoryBlock(), write_data_blocks(), xmlMallocAtomicLoc(), xmlMallocLoc(), and xmlMemStrdupLoc().
Definition at line 37 of file xmlmemory.c.
Referenced by xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemDisplay(), xmlMemDisplayLast(), xmlMemoryDump(), xmlMemShow(), xmlMemStrdupLoc(), and xmlReallocLoc().
Definition at line 36 of file xmlmemory.c.
Referenced by xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemBlocks(), xmlMemFree(), xmlMemStrdupLoc(), and xmlReallocLoc().
MEM_LIST:
keep track of all allocated blocks for error reporting Always build the memory list !
Definition at line 35 of file xmlmemory.c.
Referenced by xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemDisplay(), xmlMemDisplayLast(), xmlMemFree(), xmlMemShow(), xmlMemStrdupLoc(), xmlMemUsed(), and xmlReallocLoc().
|
static |
Definition at line 38 of file xmlmemory.c.
Referenced by xmlCleanupMemoryInternal(), xmlInitMemoryInternal(), xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemBlocks(), xmlMemDisplay(), xmlMemDisplayLast(), xmlMemFree(), xmlMemShow(), xmlMemStrdupLoc(), and xmlReallocLoc().
Definition at line 102 of file xmlmemory.c.
Referenced by xmlInitMemoryInternal(), xmlMallocAtomicLoc(), xmlMallocBreakpoint(), xmlMallocLoc(), xmlMemFree(), xmlMemStrdupLoc(), and xmlReallocLoc().
Definition at line 103 of file xmlmemory.c.
Referenced by xmlInitMemoryInternal(), xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemFree(), xmlMemStrdupLoc(), and xmlReallocLoc().