[{"data":1,"prerenderedAt":776},["ShallowReactive",2],{"imSLaX7b25":3},{"title":4,"description":5,"parent":6,"type":7,"xrefs":8,"body":10,"_type":775,"_id":4},"PFN_vkReallocationFunction","Application-defined memory reallocation function","VK_VERSION_1_0","funcpointers",[9],"VkAllocationCallbacks",{"type":11,"children":12,"toc":773},"root",[13,30,413,538,579,624,675,718,741,767],{"type":14,"tag":15,"props":16,"children":17},"element","p",{},[18,21,28],{"type":19,"value":20},"text","The type of ",{"type":14,"tag":22,"props":23,"children":25},"code",{"className":24},[],[26],{"type":19,"value":27},"pfnReallocation",{"type":19,"value":29}," is:",{"type":14,"tag":31,"props":32,"children":33},"code-group",{},[34,142],{"type":14,"tag":35,"props":36,"children":42},"pre",{"className":37,"code":38,"filename":39,"language":40,"meta":41,"style":41},"language-c shiki shiki-themes github-light-default github-dark-default","typedef void* (VKAPI_PTR *PFN_vkReallocationFunction)(\n void* pUserData,\n void* pOriginal,\n size_t size,\n size_t alignment,\n VkSystemAllocationScope allocationScope);\n","C","c","",[43],{"type":14,"tag":22,"props":44,"children":45},{"__ignoreMap":41},[46,79,93,106,120,133],{"type":14,"tag":47,"props":48,"children":51},"span",{"class":49,"line":50},"line",1,[52,58,63,69,74],{"type":14,"tag":47,"props":53,"children":55},{"style":54},"--shiki-default:#CF222E;--shiki-dark:#FF7B72",[56],{"type":19,"value":57},"typedef",{"type":14,"tag":47,"props":59,"children":60},{"style":54},[61],{"type":19,"value":62}," void*",{"type":14,"tag":47,"props":64,"children":66},{"style":65},"--shiki-default:#1F2328;--shiki-dark:#E6EDF3",[67],{"type":19,"value":68}," (VKAPI_PTR ",{"type":14,"tag":47,"props":70,"children":71},{"style":54},[72],{"type":19,"value":73},"*",{"type":14,"tag":47,"props":75,"children":76},{"style":65},[77],{"type":19,"value":78},"PFN_vkReallocationFunction)(\n",{"type":14,"tag":47,"props":80,"children":82},{"class":49,"line":81},2,[83,88],{"type":14,"tag":47,"props":84,"children":85},{"style":54},[86],{"type":19,"value":87}," void*",{"type":14,"tag":47,"props":89,"children":90},{"style":65},[91],{"type":19,"value":92}," pUserData,\n",{"type":14,"tag":47,"props":94,"children":96},{"class":49,"line":95},3,[97,101],{"type":14,"tag":47,"props":98,"children":99},{"style":54},[100],{"type":19,"value":87},{"type":14,"tag":47,"props":102,"children":103},{"style":65},[104],{"type":19,"value":105}," pOriginal,\n",{"type":14,"tag":47,"props":107,"children":109},{"class":49,"line":108},4,[110,115],{"type":14,"tag":47,"props":111,"children":112},{"style":54},[113],{"type":19,"value":114}," size_t",{"type":14,"tag":47,"props":116,"children":117},{"style":65},[118],{"type":19,"value":119}," size,\n",{"type":14,"tag":47,"props":121,"children":123},{"class":49,"line":122},5,[124,128],{"type":14,"tag":47,"props":125,"children":126},{"style":54},[127],{"type":19,"value":114},{"type":14,"tag":47,"props":129,"children":130},{"style":65},[131],{"type":19,"value":132}," alignment,\n",{"type":14,"tag":47,"props":134,"children":136},{"class":49,"line":135},6,[137],{"type":14,"tag":47,"props":138,"children":139},{"style":65},[140],{"type":19,"value":141}," VkSystemAllocationScope allocationScope);\n",{"type":14,"tag":35,"props":143,"children":148},{"className":144,"code":145,"filename":146,"language":147,"meta":41,"style":41},"language-rs shiki shiki-themes github-light-default github-dark-default","pub type PFN_vkReallocationFunction = Option\u003C\n unsafe extern \"system\" fn(\n p_user_data: *mut std::ffi::c_void,\n p_original: *mut std::ffi::c_void,\n size: usize,\n alignment: usize,\n allocation_scope: vk::SystemAllocationScope,\n ) -> *mut std::ffi::c_void\n>;\n","Rust","rs",[149],{"type":14,"tag":22,"props":150,"children":151},{"__ignoreMap":41},[152,186,214,256,292,314,334,365,404],{"type":14,"tag":47,"props":153,"children":154},{"class":49,"line":50},[155,160,165,171,176,181],{"type":14,"tag":47,"props":156,"children":157},{"style":54},[158],{"type":19,"value":159},"pub",{"type":14,"tag":47,"props":161,"children":162},{"style":54},[163],{"type":19,"value":164}," type",{"type":14,"tag":47,"props":166,"children":168},{"style":167},"--shiki-default:#953800;--shiki-dark:#FFA657",[169],{"type":19,"value":170}," PFN_vkReallocationFunction",{"type":14,"tag":47,"props":172,"children":173},{"style":54},[174],{"type":19,"value":175}," =",{"type":14,"tag":47,"props":177,"children":178},{"style":167},[179],{"type":19,"value":180}," Option",{"type":14,"tag":47,"props":182,"children":183},{"style":65},[184],{"type":19,"value":185},"\u003C\n",{"type":14,"tag":47,"props":187,"children":188},{"class":49,"line":81},[189,194,199,204,209],{"type":14,"tag":47,"props":190,"children":191},{"style":54},[192],{"type":19,"value":193}," unsafe",{"type":14,"tag":47,"props":195,"children":196},{"style":54},[197],{"type":19,"value":198}," extern",{"type":14,"tag":47,"props":200,"children":201},{"style":65},[202],{"type":19,"value":203}," \"system\" ",{"type":14,"tag":47,"props":205,"children":206},{"style":54},[207],{"type":19,"value":208},"fn",{"type":14,"tag":47,"props":210,"children":211},{"style":65},[212],{"type":19,"value":213},"(\n",{"type":14,"tag":47,"props":215,"children":216},{"class":49,"line":95},[217,222,227,232,237,242,247,251],{"type":14,"tag":47,"props":218,"children":219},{"style":65},[220],{"type":19,"value":221}," p_user_data",{"type":14,"tag":47,"props":223,"children":224},{"style":54},[225],{"type":19,"value":226},":",{"type":14,"tag":47,"props":228,"children":229},{"style":54},[230],{"type":19,"value":231}," *mut",{"type":14,"tag":47,"props":233,"children":234},{"style":65},[235],{"type":19,"value":236}," std",{"type":14,"tag":47,"props":238,"children":239},{"style":54},[240],{"type":19,"value":241},"::",{"type":14,"tag":47,"props":243,"children":244},{"style":65},[245],{"type":19,"value":246},"ffi",{"type":14,"tag":47,"props":248,"children":249},{"style":54},[250],{"type":19,"value":241},{"type":14,"tag":47,"props":252,"children":253},{"style":65},[254],{"type":19,"value":255},"c_void,\n",{"type":14,"tag":47,"props":257,"children":258},{"class":49,"line":108},[259,264,268,272,276,280,284,288],{"type":14,"tag":47,"props":260,"children":261},{"style":65},[262],{"type":19,"value":263}," p_original",{"type":14,"tag":47,"props":265,"children":266},{"style":54},[267],{"type":19,"value":226},{"type":14,"tag":47,"props":269,"children":270},{"style":54},[271],{"type":19,"value":231},{"type":14,"tag":47,"props":273,"children":274},{"style":65},[275],{"type":19,"value":236},{"type":14,"tag":47,"props":277,"children":278},{"style":54},[279],{"type":19,"value":241},{"type":14,"tag":47,"props":281,"children":282},{"style":65},[283],{"type":19,"value":246},{"type":14,"tag":47,"props":285,"children":286},{"style":54},[287],{"type":19,"value":241},{"type":14,"tag":47,"props":289,"children":290},{"style":65},[291],{"type":19,"value":255},{"type":14,"tag":47,"props":293,"children":294},{"class":49,"line":122},[295,300,304,309],{"type":14,"tag":47,"props":296,"children":297},{"style":65},[298],{"type":19,"value":299}," size",{"type":14,"tag":47,"props":301,"children":302},{"style":54},[303],{"type":19,"value":226},{"type":14,"tag":47,"props":305,"children":306},{"style":167},[307],{"type":19,"value":308}," usize",{"type":14,"tag":47,"props":310,"children":311},{"style":65},[312],{"type":19,"value":313},",\n",{"type":14,"tag":47,"props":315,"children":316},{"class":49,"line":135},[317,322,326,330],{"type":14,"tag":47,"props":318,"children":319},{"style":65},[320],{"type":19,"value":321}," alignment",{"type":14,"tag":47,"props":323,"children":324},{"style":54},[325],{"type":19,"value":226},{"type":14,"tag":47,"props":327,"children":328},{"style":167},[329],{"type":19,"value":308},{"type":14,"tag":47,"props":331,"children":332},{"style":65},[333],{"type":19,"value":313},{"type":14,"tag":47,"props":335,"children":337},{"class":49,"line":336},7,[338,343,347,352,356,361],{"type":14,"tag":47,"props":339,"children":340},{"style":65},[341],{"type":19,"value":342}," allocation_scope",{"type":14,"tag":47,"props":344,"children":345},{"style":54},[346],{"type":19,"value":226},{"type":14,"tag":47,"props":348,"children":349},{"style":65},[350],{"type":19,"value":351}," vk",{"type":14,"tag":47,"props":353,"children":354},{"style":54},[355],{"type":19,"value":241},{"type":14,"tag":47,"props":357,"children":358},{"style":167},[359],{"type":19,"value":360},"SystemAllocationScope",{"type":14,"tag":47,"props":362,"children":363},{"style":65},[364],{"type":19,"value":313},{"type":14,"tag":47,"props":366,"children":368},{"class":49,"line":367},8,[369,374,379,383,387,391,395,399],{"type":14,"tag":47,"props":370,"children":371},{"style":65},[372],{"type":19,"value":373}," ) ",{"type":14,"tag":47,"props":375,"children":376},{"style":54},[377],{"type":19,"value":378},"->",{"type":14,"tag":47,"props":380,"children":381},{"style":54},[382],{"type":19,"value":231},{"type":14,"tag":47,"props":384,"children":385},{"style":65},[386],{"type":19,"value":236},{"type":14,"tag":47,"props":388,"children":389},{"style":54},[390],{"type":19,"value":241},{"type":14,"tag":47,"props":392,"children":393},{"style":65},[394],{"type":19,"value":246},{"type":14,"tag":47,"props":396,"children":397},{"style":54},[398],{"type":19,"value":241},{"type":14,"tag":47,"props":400,"children":401},{"style":65},[402],{"type":19,"value":403},"c_void\n",{"type":14,"tag":47,"props":405,"children":407},{"class":49,"line":406},9,[408],{"type":14,"tag":47,"props":409,"children":410},{"style":65},[411],{"type":19,"value":412},">;\n",{"type":14,"tag":414,"props":415,"children":416},"ul",{},[417,443,484,495,511],{"type":14,"tag":418,"props":419,"children":420},"li",{},[421,427,429,435,436,441],{"type":14,"tag":22,"props":422,"children":424},{"className":423},[],[425],{"type":19,"value":426},"pUserData",{"type":19,"value":428}," is the value specified for\n",{"type":14,"tag":430,"props":431,"children":433},"a",{"href":432},"/man/VkAllocationCallbacks",[434],{"type":19,"value":9},{"type":19,"value":241},{"type":14,"tag":22,"props":437,"children":439},{"className":438},[],[440],{"type":19,"value":426},{"type":19,"value":442}," in the allocator specified\nby the application.",{"type":14,"tag":418,"props":444,"children":445},{},[446,452,454,459,461,467,469,474,476,482],{"type":14,"tag":22,"props":447,"children":449},{"className":448},[],[450],{"type":19,"value":451},"pOriginal",{"type":19,"value":453}," ",{"type":14,"tag":455,"props":456,"children":458},"normative",{"type":457},"must",[],{"type":19,"value":460}," be either ",{"type":14,"tag":22,"props":462,"children":464},{"className":463},[],[465],{"type":19,"value":466},"NULL",{"type":19,"value":468}," or a pointer previously returned\nby ",{"type":14,"tag":22,"props":470,"children":472},{"className":471},[],[473],{"type":19,"value":27},{"type":19,"value":475}," or ",{"type":14,"tag":22,"props":477,"children":479},{"className":478},[],[480],{"type":19,"value":481},"pfnAllocation",{"type":19,"value":483}," of a compatible\nallocator.",{"type":14,"tag":418,"props":485,"children":486},{},[487,493],{"type":14,"tag":22,"props":488,"children":490},{"className":489},[],[491],{"type":19,"value":492},"size",{"type":19,"value":494}," is the size in bytes of the requested allocation.",{"type":14,"tag":418,"props":496,"children":497},{},[498,504,506,509],{"type":14,"tag":22,"props":499,"children":501},{"className":500},[],[502],{"type":19,"value":503},"alignment",{"type":19,"value":505}," is the requested alignment of the allocation in bytes\nand ",{"type":14,"tag":455,"props":507,"children":508},{"type":457},[],{"type":19,"value":510}," be a power of two.",{"type":14,"tag":418,"props":512,"children":513},{},[514,520,522,528,530,536],{"type":14,"tag":22,"props":515,"children":517},{"className":516},[],[518],{"type":19,"value":519},"allocationScope",{"type":19,"value":521}," is a ",{"type":14,"tag":430,"props":523,"children":525},{"href":524},"/man/VkSystemAllocationScope",[526],{"type":19,"value":527},"VkSystemAllocationScope",{"type":19,"value":529}," value\nspecifying the allocation scope of the lifetime of the allocation, as\ndescribed ",{"type":14,"tag":430,"props":531,"children":533},{"href":532},"/man/VkSystemAllocationScope#memory-host-allocation-scope",[534],{"type":19,"value":535},"here",{"type":19,"value":537},".",{"type":14,"tag":15,"props":539,"children":540},{},[541,543,548,549,552,554,559,561,564,566,571,573,577],{"type":19,"value":542},"If the reallocation was successful, ",{"type":14,"tag":22,"props":544,"children":546},{"className":545},[],[547],{"type":19,"value":27},{"type":19,"value":453},{"type":14,"tag":455,"props":550,"children":551},{"type":457},[],{"type":19,"value":553}," return an\nallocation with enough space for ",{"type":14,"tag":22,"props":555,"children":557},{"className":556},[],[558],{"type":19,"value":492},{"type":19,"value":560}," bytes, and the contents of the\noriginal allocation from bytes zero to min(original size, new size) -\n1 ",{"type":14,"tag":455,"props":562,"children":563},{"type":457},[],{"type":19,"value":565}," be preserved in the returned allocation.\nIf ",{"type":14,"tag":22,"props":567,"children":569},{"className":568},[],[570],{"type":19,"value":492},{"type":19,"value":572}," is larger than the old size, the contents of the additional\nspace are undefined:.\nIf satisfying these requirements involves creating a new allocation, then\nthe old allocation ",{"type":14,"tag":455,"props":574,"children":576},{"type":575},"should",[],{"type":19,"value":578}," be freed.",{"type":14,"tag":15,"props":580,"children":581},{},[582,584,589,591,596,598,603,604,607,609,615,617,622],{"type":19,"value":583},"If ",{"type":14,"tag":22,"props":585,"children":587},{"className":586},[],[588],{"type":19,"value":451},{"type":19,"value":590}," is ",{"type":14,"tag":22,"props":592,"children":594},{"className":593},[],[595],{"type":19,"value":466},{"type":19,"value":597},", then ",{"type":14,"tag":22,"props":599,"children":601},{"className":600},[],[602],{"type":19,"value":27},{"type":19,"value":453},{"type":14,"tag":455,"props":605,"children":606},{"type":457},[],{"type":19,"value":608}," behave\nequivalently to a call to ",{"type":14,"tag":430,"props":610,"children":612},{"href":611},"/man/PFN_vkAllocationFunction",[613],{"type":19,"value":614},"PFN_vkAllocationFunction",{"type":19,"value":616}," with the same\nparameter values (without ",{"type":14,"tag":22,"props":618,"children":620},{"className":619},[],[621],{"type":19,"value":451},{"type":19,"value":623},").",{"type":14,"tag":15,"props":625,"children":626},{},[627,628,633,635,640,641,644,646,652,654,659,661,667,669,674],{"type":19,"value":583},{"type":14,"tag":22,"props":629,"children":631},{"className":630},[],[632],{"type":19,"value":492},{"type":19,"value":634}," is zero, then ",{"type":14,"tag":22,"props":636,"children":638},{"className":637},[],[639],{"type":19,"value":27},{"type":19,"value":453},{"type":14,"tag":455,"props":642,"children":643},{"type":457},[],{"type":19,"value":645}," behave equivalently\nto a call to ",{"type":14,"tag":430,"props":647,"children":649},{"href":648},"/man/PFN_vkFreeFunction",[650],{"type":19,"value":651},"PFN_vkFreeFunction",{"type":19,"value":653}," with the same ",{"type":14,"tag":22,"props":655,"children":657},{"className":656},[],[658],{"type":19,"value":426},{"type":19,"value":660},"\nparameter value, and ",{"type":14,"tag":22,"props":662,"children":664},{"className":663},[],[665],{"type":19,"value":666},"pMemory",{"type":19,"value":668}," equal to ",{"type":14,"tag":22,"props":670,"children":672},{"className":671},[],[673],{"type":19,"value":451},{"type":19,"value":537},{"type":14,"tag":15,"props":676,"children":677},{},[678,679,684,686,691,693,696,698,703,705,710,712,717],{"type":19,"value":583},{"type":14,"tag":22,"props":680,"children":682},{"className":681},[],[683],{"type":19,"value":451},{"type":19,"value":685}," is non-",{"type":14,"tag":22,"props":687,"children":689},{"className":688},[],[690],{"type":19,"value":466},{"type":19,"value":692},", the implementation ",{"type":14,"tag":455,"props":694,"children":695},{"type":457},[],{"type":19,"value":697}," ensure that\n",{"type":14,"tag":22,"props":699,"children":701},{"className":700},[],[702],{"type":19,"value":503},{"type":19,"value":704}," is equal to the ",{"type":14,"tag":22,"props":706,"children":708},{"className":707},[],[709],{"type":19,"value":503},{"type":19,"value":711}," used to originally allocate\n",{"type":14,"tag":22,"props":713,"children":715},{"className":714},[],[716],{"type":19,"value":451},{"type":19,"value":537},{"type":14,"tag":15,"props":719,"children":720},{},[721,723,728,729,734,736,739],{"type":19,"value":722},"If this function fails and ",{"type":14,"tag":22,"props":724,"children":726},{"className":725},[],[727],{"type":19,"value":451},{"type":19,"value":685},{"type":14,"tag":22,"props":730,"children":732},{"className":731},[],[733],{"type":19,"value":466},{"type":19,"value":735}," the application\n",{"type":14,"tag":455,"props":737,"children":738},{"type":457},[],{"type":19,"value":740}," not free the old allocation.",{"type":14,"tag":15,"props":742,"children":743},{},[744,749,750,753,755,766],{"type":14,"tag":22,"props":745,"children":747},{"className":746},[],[748],{"type":19,"value":27},{"type":19,"value":453},{"type":14,"tag":455,"props":751,"children":752},{"type":457},[],{"type":19,"value":754}," follow the same\n",{"type":14,"tag":430,"props":756,"children":758},{"href":757},"/man/PFN_vkAllocationFunction#vkAllocationFunction_return_rules",[759,761],{"type":19,"value":760},"rules for return values as\n",{"type":14,"tag":22,"props":762,"children":764},{"className":763},[],[765],{"type":19,"value":614},{"type":19,"value":537},{"type":14,"tag":768,"props":769,"children":770},"style",{},[771],{"type":19,"value":772},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":41,"searchDepth":81,"depth":81,"links":774},[],"markdown",1729612426081]