en:docs:fapi:dosfreeseg

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:docs:fapi:dosfreeseg [2021/09/17 05:57] prokusheven:docs:fapi:dosfreeseg [2021/12/05 09:56] (current) prokushev
Line 16: Line 16:
 ===== Return Code ===== ===== Return Code =====
  
-  rc (USHORT) - return+rc ([[USHORT]]) - return
  
 Return code descriptions are: Return code descriptions are:
Line 26: Line 26:
  
  
-DosFreeSeg frees selectors to segments returned by allocation calls to [[DosAllocSeg]], [[DosAllocShrSeg]], and [[DosAllocHuge]]. In addition, DosFreeSeg frees a selector returned by a call to [[DosCreateCSAlias]]. If a CS alias selector has been created for a data segment by a call to DosCreateCSAlias, the CS alias selector is still valid after the segment's data selector has been freed.+DosFreeSeg frees selectors to segments returned by allocation calls to [[DosAllocSeg]], [[DosAllocShrSeg]], and [[DosAllocHuge]]. In addition, DosFreeSeg frees a selector returned by a call to [[DosCreateCSAlias]]. If a CS alias selector has been created for a data segment by a call to [[DosCreateCSAlias]], the CS alias selector is still valid after the segment's data selector has been freed.
  
 When allocated memory is shared, all selectors to the shared memory must be freed before the memory is deallocated. For example, if memory allocated by [[DosAllocSeg]] or [[DosAllocHuge]] has been given to another process with [[DosGiveSeg]], the giver usually frees its selector by a call to DosFreeSeg. The recipient, in turn, frees the selector passed to it, after it has accessed the shared memory with [[DosGetSeg]]. When allocated memory is shared, all selectors to the shared memory must be freed before the memory is deallocated. For example, if memory allocated by [[DosAllocSeg]] or [[DosAllocHuge]] has been given to another process with [[DosGiveSeg]], the giver usually frees its selector by a call to DosFreeSeg. The recipient, in turn, frees the selector passed to it, after it has accessed the shared memory with [[DosGetSeg]].